JavaScript实现鼠标放上去之后高亮显示且隔行换色
JavaScript 实现 显示 鼠标 之后 高亮 隔行
2023-09-14 08:57:41 时间
<!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>
相关文章
- 解决Eclipse报errors running builder ‘javascript validator’ on project
- JavaScript经典代码【二】【javascript判断用户点了鼠标左键还是右键】
- 在android中实现webview与javascript之间的交互(转)
- [Javascript] structuredClone - deep clone object
- [Javascript] Keyword 'in' to check prop exists on Object
- [Javascript] Await a JavaScript Promise in an async Function with the await Operator
- [Javascript] 4 ways to remove duplicates elements from an array with Javascript
- [Javascript] Avoiding Mutations in JavaScript with Immutable Data Structures
- SAP UI5 本地开发如何实现 XML 和 JavaScript 代码的自动完成和嵌入式 API 文档自动显示试读版
- JavaScript 函数 window.matchMedia 的用途
- 快速排序(Quicksort)的Javascript实现
- Atitit.实现继承的原理and方法java javascript .net c# php ...
- 通过阶乘的例子,练习在JavaScript, Scala和ABAP里实现尾递归(Tail Recursion)
- 一段简单的JavaScript代码,实现在同一网页输出多个图标的功能
- JavaScript里类和私有属性的两种实现方式
- 用尾递归(tailRecursive)实现的阶乘-JavaScript版本
- css和JavaScript实现的星云动画效果
- JavaScript实现网页关灯效果
- brython 文档之javascript模块
- javascript基础修炼(11)——DOM-DIFF的实现
- WebViewJavascriptBridge-Obj-C和JavaScript互通消息的桥梁
- python web py入门(29)- javascript的赋值操作
- JavaScript 表单