zoukankan      html  css  js  c++  java
  • JavaScript实现鼠标放上去之后高亮显示且隔行换色

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <span style="white-space:pre">	</span><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <span style="white-space:pre">	</span><title>鼠标放上去之后隔行换色</title>
    <span style="white-space:pre">	</span><script type="text/javascript" src="js/jquery-1.8.3.js"></script>
    <span style="white-space:pre">	</span><script type="text/javascript">
    <span style="white-space:pre">		</span>$(function(){
    <span style="white-space:pre">			</span>$("tr:even").css("background-color","orange");
    <span style="white-space:pre">			</span>$("tr:odd").css("background-color","pink");
    <span style="white-space:pre">			</span>$("td").hover(function(){
    <span style="white-space:pre">				</span>$(this).addClass('cs1');
    <span style="white-space:pre">			</span>},function(){
    <span style="white-space:pre">				</span>$(this).removeClass('cs1');
    <span style="white-space:pre">			</span>})
    <span style="white-space:pre">		</span>})
    <span style="white-space:pre">	</span></script>
    <span style="white-space:pre">	</span><style type="text/css">
    <span style="white-space:pre">		</span>tr{
    <span style="white-space:pre">			</span>text-align: center;
    <span style="white-space:pre">			</span>/*background-color: orange;*/
    <span style="white-space:pre">		</span>}
    <span style="white-space:pre">		</span>.cs1{
    <span style="white-space:pre">			</span>background-color: red;
    <span style="white-space:pre">			</span>
    <span style="white-space:pre">		</span>}
    <span style="white-space:pre">		</span>div{
    <span style="white-space:pre">			</span>margin:0px auto;
    <span style="white-space:pre">		</span>}
    <span style="white-space:pre">	</span></style>
    </head>
    <body>
    <span style="white-space:pre">	</span><table border="1" cellspacing="0" width="50%">
    <span style="white-space:pre">		</span><tr>
    <span style="white-space:pre">			</span><td>家里的福克斯愤怒地说开发都是法律的时间发了</td>
    <span style="white-space:pre">		</span></tr>
    <span style="white-space:pre">		</span><tr>
    <span style="white-space:pre">			</span><td>家里的福克斯愤怒地说开发法律的电风扇时间发了</td>
    <span style="white-space:pre">		</span></tr>
    <span style="white-space:pre">		</span><tr>
    <span style="white-space:pre">			</span><td>家里的福克斯愤怒地说开发法律方式放到的时间发了</td>
    <span style="white-space:pre">		</span></tr>
    <span style="white-space:pre">		</span><tr>
    <span style="white-space:pre">			</span><td>家里的福克斯愤怒地说开发法放到是律的时间发了</td>
    <span style="white-space:pre">		</span></tr>
    <span style="white-space:pre">		</span><tr>
    <span style="white-space:pre">			</span><td>家里的福克斯愤怒方式地说开服饰发法律的时间发了</td>
    <span style="white-space:pre">		</span></tr>
    <span style="white-space:pre">		</span><tr>
    <span style="white-space:pre">			</span><td>家里的福克斯愤怒地说开佛挡杀佛方式发法律的时间发了</td>
    <span style="white-space:pre">		</span></tr>
    <span style="white-space:pre">		</span><tr>
    <span style="white-space:pre">			</span><td>家里的福克斯愤怒地说开佛挡杀佛方式发法律的时间发了</td>
    <span style="white-space:pre">		</span></tr>
    <span style="white-space:pre">		</span><tr>
    <span style="white-space:pre">			</span><td>家里的福克斯愤怒地说佛挡杀佛方式开发法律的时间发了</td>
    <span style="white-space:pre">		</span></tr>
    <span style="white-space:pre">	</span></table>
    </body>
    </html>
    
  • 相关阅读:
    speedtest测速网站测速节点添加流程
    Mac 系统更新怎么忽略
    【木马免杀思路】msf木马免杀 python转exe(一) 截止2021年8月8日通杀360,火绒,微步
    启动docker desktop for mac时,会自动打开IntelliJ IDEA
    【漏洞复现系列】Apache Solr SSRF文件读取漏洞(附0day POC)
    【维持权限】schtasks命令
    【cowrie蜜罐系列2】cowrie蜜罐配置代理成为高交互蜜罐(避免踩坑)
    【cowrie蜜罐系列1】cowrie蜜罐部署并配置mysql
    【漏洞复现系列】ThinkPHP 5 远程命令执行
    【漏洞复现系列】WebLogic XMLDecoder反序列化漏洞(CVE-2017-10271)
  • 原文地址:https://www.cnblogs.com/a1111/p/6540385.html
Copyright © 2011-2022 走看看