光棒效果:建立一个表格,鼠标放到哪一行,哪一行的颜色就改变,鼠标离开那一行,那一行的颜色就恢复到原来的颜色

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head> <body>
<table width="" border="" cellspacing="" cellpadding="">
<tr onmouseover="shangqu(this)" onmouseout="likai(this)" bgcolor="#FFFF66">
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
</tr>
<tr onmouseover="shangqu(this)" onmouseout="likai(this)" bgcolor="#FFFF66">
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
</tr>
<tr onmouseover="shangqu(this)" onmouseout="likai(this)" bgcolor="#FFFF66">
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
</tr>
<tr onmouseover="shangqu(this)" onmouseout="likai(this)" bgcolor="#FFFF66">
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
</tr>
<tr onmouseover="shangqu(this)" onmouseout="likai(this)" bgcolor="#FFFF66">
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
<td height="">&nbsp;</td>
</tr>
</table>
</body>
<script type="text/javascript"> function shangqu(a)
{
a.style.backgroundColor="red";
}
function likai(b)
{
b.style.backgroundColor="#FFFF66";
}
</script> </html>

HTML——JAVASCRIPT——光棒效果的更多相关文章

  1. 使用javaScript和JQuery制作经典面试题:光棒效果

    使用javaScript与jQuery添加CSS样式的区别和步骤 使用javaScript制作光棒效果 --首先是javaScript <script> $(function () { v ...

  2. webform 光棒效果,删除操作弹出确定取消窗口

    鼠标移入onmouseover和鼠标移出onmouseout,代码里没大写我这也就不大写了.那首先,我们得获取Class为tr_item里的所有东西,也就是项标签里的数据.然后呢,我们定义一个oldC ...

  3. jquery添加光棒效果的各种方式以及简单动画复杂动画

    过滤器.绑定事件.动画   一.基本过滤器 语法 描述 返回值 :first 选取第一个元素 单个元素 :last 选取最后一个元素 单个元素 :not(selector) 选取去除所有与给定选择器匹 ...

  4. asp.net操作GridView添删改查的两种方法 及 光棒效果

    这部份小内容很想写下来了,因为是基础中的基础,但是近来用的比较少,又温习了一篇,发现有点陌生了,所以,还是写一下吧. 方法一:使用Gridview本身自带的事件处理,代码如下(注意:每次操作完都得重新 ...

  5. HTML7常用的类型刮刮乐 光棒效果

    常用的类型: 1.数学: Math.ceil():天花板数 Math.floor():地板数 Math.round():四舍五入取整数 Math.random():生成0-1之间的随机数   2.日期 ...

  6. Jquery实现光棒效果

    <script type="text/javascript"> $(function () { var $bac; $("#d1 tr").hove ...

  7. jQuery中.bind() .live() .delegate() .on()的区别 和 三种方式写光棒事件 动画

    地狱的镰刀 bind(type,[data],fn) 为每个匹配元素的特定事件绑定事件处理函数. $("a").bind("click",function(){ ...

  8. 用js写出光棒效应的两种方法与jquery的两中方法

    <script src="js/jQuery1.11.1.js" type="text/javascript"></script> &l ...

  9. JavaScript--------------------jQuery中.bind() .live() .delegate() .on()的区别 和 三种方式写光棒事件 动画

    bind(type,[data],fn) 为每个匹配元素的特定事件绑定事件处理函数. $("a").bind("click",function(){alert( ...

随机推荐

  1. MPreview.js

    Word,PPT 文档预览组件(图片预览组件) 移动端请移步 MPreview.mobile Demo参考 http://demo.webjyh.com/MPreview/ 特此说明 此插件是我在项目 ...

  2. 【数位DP】【HDU2089】不要62

    不要62 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submi ...

  3. Javascript进阶篇——( 事件响应)笔记整理

    什么是事件 JavaScript 创建动态页面.事件是可以被 JavaScript 侦测到的行为. 网页中的每个元素都可以产生某些可以触发 JavaScript 函数或程序的事件. 鼠标单击事件(on ...

  4. Failed to create the Java Virtual Machine (Myeclipse或者eclipse启动报错)

    把某几个值改为原来的0.5倍就ok了(我就这么解决的)   eclipse.ini如下:   -startupplugins/org.eclipse.equinox.launcher_1.2.0.v2 ...

  5. VMVare虚拟机的异常处理---内部错误

    由于昨天晚上关闭虚机时手快,直接把机器睡眠了.今天早上开机后,虚机显示启动状态,但是无法连接.搜了一下,网上说删掉.lk锁文件就可以了,删掉后,没有反应,强制关闭,再次启动VM,还是打不开,显示内部错 ...

  6. 沼跃鱼早已看穿了一切 C/C++

      沼跃鱼早已看穿了一切 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 593  Solved: 229[Submit][Status][Web Boa ...

  7. C学习-fgets()篇1

    学习fgets()函数时发现了一个问题,先贴代码 #include<stdio.h> #include<string.h> #include<ctype.h> vo ...

  8. plsql基本语法(

    1. 定义常量的语法格式    常量名 constant 类型标识符 [not null]:=值;    常量,包括后面的变量名都必须以字母开头,不能有空格,不能超过30个字符长度,同时不能和保留字同 ...

  9. fltk demo

    背景: 基于microwindows nano-X上面运行fltk demo,是nano-X API 预留的fltk接口. 运行环境及程序版本: microwindows-0.89pre8 (源文件必 ...

  10. 常用的PHP正则表达式汇总

    PHP中的常用正则表达式集锦: 匹配中文字符的正则表达式: [\u4e00-\u9fa5] 评注:匹配中文还真是个头疼的事,有了这个表达式就好办了 匹配双字节字符(包括汉字在内):[^\x00-\xf ...