Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 新手求助想做一个这样的网页

新手求助想做一个这样的网页

Jun 23, 2016 pm 02:18 PM

轮班牌的,当1#双击变红跳到后面的时候,其它列的1#全部变暗下来!再双击变黑后其它的列也自动变黑!每个号码代表一个员工。用什么环境比较好实现啊!


回复讨论(解决方案)

你这个需求很适合用jquery做...对于web开发者来说 你这应该叫 对dom进行操作

当点击任意一个编号时

第一条语句:当前1#变红,其他1#变灰    
第二条语句:当前1#移到第五列 其他的向前递补

因为不知道你的dom结构,我假设一个

$("td").click(function(){    //点某个td时    var con = $(this).text();    //获取点的是哪个    $(this).css("color","red");   //当前的变红,    $("td:contains('"+con+"')").not(this).css("color","grey");   //非当前的同内容的变灰    $(this).siblings().last().after($(this).clone());   //当前节点复制到最后    $(this).remove();   //当前节点删除});
Copy after login
Copy after login



晚上WOWing...不好给你测试 大致思路这样 应该还是不算难的.

你这个需求很适合用jquery做...对于web开发者来说 你这应该叫 对dom进行操作

当点击任意一个编号时

第一条语句:当前1#变红,其他1#变灰
第二条语句:当前1#移到第五列 其他的向前递补

因为不知道你的dom结构,我假设一个

$("td").click(function(){    //点某个td时    var con = $(this).text();    //获取点的是哪个    $(this).css("color","red");   //当前的变红,    $("td:contains('"+con+"')").not(this).css("color","grey");   //非当前的同内容的变灰    $(this).siblings().last().after($(this).clone());   //当前节点复制到最后    $(this).remove();   //当前节点删除});
Copy after login
Copy after login



晚上WOWing...不好给你测试 大致思路这样 应该还是不算难的.

谢谢!可以帮我做一个吗?

用JS做前端,每一个编号是一个DIV,一个DIV给一个单独的ID,相同编号的DIV给同一个class
双击之后与这个class同名的其它DIV全部变为灰色,然后单独给这个被双击的DIV配一个红色就行
至于移动的效果,DIV的宽度是一样的,所以直接改变距离左边的距离就可以了

用JS做前端,每一个编号是一个DIV,一个DIV给一个单独的ID,相同编号的DIV给同一个class
双击之后与这个class同名的其它DIV全部变为灰色,然后单独给这个被双击的DIV配一个红色就行
至于移动的效果,DIV的宽度是一样的,所以直接改变距离左边的距离就可以了
我菜的不能再菜了!建网站就会弄!写源码真心是才学不到一星期啊,学习资料下了很多,搞的头大了!可以直接做一个让我借鉴学习吗?

恩 刚才看到你的站内信 给你写了个小demo

http://www.colg.biz/demo/d2.html

按照你的需求来的
当1#双击变红跳到后面的时候,其它列的1#全部变暗下来!再双击变黑后其它的列也自动变黑!

全部代码

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title> New Document </title>  <meta name="Generator" content="EditPlus">  <meta name="Author" content="">  <meta name="Keywords" content="">  <meta name="Description" content="">  <meta charset="utf-8"><title> test</title><style></style><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script><script language="javascript">$(document).ready(function(){	$("td").live("dblclick",function(){    //点某个td时		var con = $(this).text();    //获取点的是哪个		if($(this).hasClass("red")){			$(this).css("color","black").removeClass("red");   //当前的变红,			$("td:contains('"+con+"')").not(this).css("color","black").removeClass("red");   //非当前的同内容的变灰		}else{			$(this).css("color","red").addClass("red");   //当前的变红,			$("td:contains('"+con+"')").not(this).css("color","grey").removeClass("red");   //非当前的同内容的变灰			$(this).siblings().last().after($(this).clone());   //当前节点复制到最后			$(this).remove();   //当前节点删除		}	});});</script></head><body>给CSDN http://bbs.csdn.net/topics/390536589 做的demo<table	border=1 width=400>	<th>		<td colspan="6">工作流水</td>	</th>	<tr>		<td>项目1</td>		<td>1#</td>		<td>2#</td>		<td>3#</td>		<td>4#</td>		<td>5#</td>	<tr>	<tr>		<td>项目2</td>		<td>1#</td>		<td>2#</td>		<td>3#</td>		<td></td>		<td></td>	<tr>	<tr>		<td>项目3</td>		<td>1#</td>		<td>2#</td>		<td></td>		<td></td>		<td>5#</td>	<tr>	<tr>		<td>项目4</td>		<td>1#</td>		<td>2#</td>		<td>3#</td>		<td>4#</td>		<td>5#</td>	<tr>	<tr>		<td>项目5</td>		<td>1#</td>		<td>2#</td>		<td></td>		<td>4#</td>		<td></td>	<tr>	<tr>		<td>项目6</td>		<td>1#</td>		<td>2#</td>		<td>3#</td>		<td>4#</td>		<td>5#</td>	<tr>	<tr>		<td>项目7</td>		<td>1#</td>		<td></td>		<td>3#</td>		<td></td>		<td>5#</td>	<tr>	<tr>		<td>项目8</td>		<td>1#</td>		<td>2#</td>		<td>3#</td>		<td>4#</td>		<td>5#</td>	<tr></table></body></html>
Copy after login
Copy after login

通过js控制css样子,如果你会写js,这个问题解决就可解决。

恩 刚才看到你的站内信 给你写了个小demo

http://www.colg.biz/demo/d2.html

按照你的需求来的
当1#双击变红跳到后面的时候,其它列的1#全部变暗下来!再双击变黑后其它的列也自动变黑!

全部代码

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title> New Document </title>  <meta name="Generator" content="EditPlus">  <meta name="Author" content="">  <meta name="Keywords" content="">  <meta name="Description" content="">  <meta charset="utf-8"><title> test</title><style></style><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script><script language="javascript">$(document).ready(function(){	$("td").live("dblclick",function(){    //点某个td时		var con = $(this).text();    //获取点的是哪个		if($(this).hasClass("red")){			$(this).css("color","black").removeClass("red");   //当前的变红,			$("td:contains('"+con+"')").not(this).css("color","black").removeClass("red");   //非当前的同内容的变灰		}else{			$(this).css("color","red").addClass("red");   //当前的变红,			$("td:contains('"+con+"')").not(this).css("color","grey").removeClass("red");   //非当前的同内容的变灰			$(this).siblings().last().after($(this).clone());   //当前节点复制到最后			$(this).remove();   //当前节点删除		}	});});</script></head><body>给CSDN http://bbs.csdn.net/topics/390536589 做的demo<table	border=1 width=400>	<th>		<td colspan="6">工作流水</td>	</th>	<tr>		<td>项目1</td>		<td>1#</td>		<td>2#</td>		<td>3#</td>		<td>4#</td>		<td>5#</td>	<tr>	<tr>		<td>项目2</td>		<td>1#</td>		<td>2#</td>		<td>3#</td>		<td></td>		<td></td>	<tr>	<tr>		<td>项目3</td>		<td>1#</td>		<td>2#</td>		<td></td>		<td></td>		<td>5#</td>	<tr>	<tr>		<td>项目4</td>		<td>1#</td>		<td>2#</td>		<td>3#</td>		<td>4#</td>		<td>5#</td>	<tr>	<tr>		<td>项目5</td>		<td>1#</td>		<td>2#</td>		<td></td>		<td>4#</td>		<td></td>	<tr>	<tr>		<td>项目6</td>		<td>1#</td>		<td>2#</td>		<td>3#</td>		<td>4#</td>		<td>5#</td>	<tr>	<tr>		<td>项目7</td>		<td>1#</td>		<td></td>		<td>3#</td>		<td></td>		<td>5#</td>	<tr>	<tr>		<td>项目8</td>		<td>1#</td>		<td>2#</td>		<td>3#</td>		<td>4#</td>		<td>5#</td>	<tr></table></body></html>
Copy after login
Copy after login



谢谢!
项目那个也会动我改了下
nbsp;HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

 


   美雅剪烫工作流水牌 
  
  
  
  
  

 test

<script></script>

<script> <br /> $(document).ready(function(){ <br /> $("td").live("dblclick",function(){ //点某个td时 <br /> var con = $(this).text(); //获取点的是哪个 <br /> if($(this).hasClass("red")){ <br /> $(this).css("color","black").removeClass("red"); //当前的变红, <br /> $("td:contains('"+con+"')").not(this).css("color","black").removeClass("red"); //非当前的同内容的变灰 <br /> }else{ <br /> $(this).css("color","red").addClass("red"); //当前的变红, <br /> $("td:contains('"+con+"')").not(this).css("color","grey").removeClass("red"); //非当前的同内容的变灰 <br /> $(this).siblings().last().after($(this).clone()); //当前节点复制到最后 <br /> $(this).remove(); //当前节点删除 <br /> } <br /> }); <br /> }); <br /> </script>














































































美雅剪烫工作流水双击跳牌,双击红色开牌,红色代表该项目在忙,灰色表示该项目没空接
女宾剪吹 5号欧文 6号冬冬 3号杨松 9号杨威 18号小赵
女宾设计 5号欧文 6号冬冬 3号杨松 9号杨威 18号小赵
男宾剪吹 18号小赵 2号张柳 9号杨威 7号威 3号杨松
男宾设计 2号张柳 18号小赵 9号杨威 3号杨松 28号欧阳
技师烫发 22号妙君 17号邓磊 19号石兵
技师染发 22号妙君 17号邓磊 19号石兵
技师洗头 24号海燕 22号妙君 26号巧凤 11号熊芳 25号欣泓 16号华娟 17号邓磊 19号石兵 12号松余
接待 24号海燕 22号妙君 26号巧凤 11号熊芳 25号欣泓 16号华娟 17号邓磊 19号石兵 12号松余



如果要实现多个页面同步,不要一刷新就还原了!要用什么代码呢?

多页面同步 那就将排序后的结果存入数据库  要显示的地方从数据库读取 生成  不就可以了吗?

多页面同步 那就将排序后的结果存入数据库  要显示的地方从数据库读取 生成  不就可以了吗?

数据库??B/S啊!


多页面同步 那就将排序后的结果存入数据库  要显示的地方从数据库读取 生成  不就可以了吗?

数据库??B/S啊! 听说过没见过啊!

那你描述下你多个页面同步的这个需求大概啥样的  ...

呼唤高手来看下... 不依靠后端我还真不知道怎么做这个...

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Explain the concept of late static binding in PHP. Explain the concept of late static binding in PHP. Mar 21, 2025 pm 01:33 PM

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

How does session hijacking work and how can you mitigate it in PHP? How does session hijacking work and how can you mitigate it in PHP? Apr 06, 2025 am 12:02 AM

Session hijacking can be achieved through the following steps: 1. Obtain the session ID, 2. Use the session ID, 3. Keep the session active. The methods to prevent session hijacking in PHP include: 1. Use the session_regenerate_id() function to regenerate the session ID, 2. Store session data through the database, 3. Ensure that all session data is transmitted through HTTPS.

Describe the SOLID principles and how they apply to PHP development. Describe the SOLID principles and how they apply to PHP development. Apr 03, 2025 am 12:04 AM

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

How to automatically set permissions of unixsocket after system restart? How to automatically set permissions of unixsocket after system restart? Mar 31, 2025 pm 11:54 PM

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

How to debug CLI mode in PHPStorm? How to debug CLI mode in PHPStorm? Apr 01, 2025 pm 02:57 PM

How to debug CLI mode in PHPStorm? When developing with PHPStorm, sometimes we need to debug PHP in command line interface (CLI) mode...

See all articles