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

<!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. C++中如何建立一个顺序表

    准备数据 #define MAXLEN 100 //定义顺序表的最大长度 struct DATA { char key[10]; //结点的关键字 char name[20]; int age; }; ...

  2. Davinci开发板DM368 nandwrite.c简要分析

    #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <limits.h ...

  3. Android设置背景

    一.设置图片背景 首先你先将一个的背景图片存入工程中res/drawble(当然drawble-hdpi.drawble-mdpi.drawble-ldpi中一个或者几个文件夹都可)文件夹中.假如我存 ...

  4. 用MVC4+EF改写XXX系统的计划--前言

    感觉自己工作了三年,重来没有自己一个人写一个项目,从开始的策划,功能需求,业务逻辑,扩展,性能优化等等方面去做,从今天起准备发比半年时间重写XXX项目,每天中午和晚上分别花半个小时和一个小时开发,周末 ...

  5. HDU 1071 - The area

    求曲线和直线围成的面积 求表达式,求积分 #include <iostream> using namespace std; ],y[]; int t; double k,m;//fx1: ...

  6. u-boot基本命令

    1.查看环境变量 printenv 2.网络相关命令 设置开发板ip:setenv ipaddr 192.168.2.110 设置子网掩码:setenv netmask 255.255.255.0 设 ...

  7. JavaScript中setTimeout和setInterval的使用

    相同点:这两个方法都可以用来实现在一个固定的时间之后去实现JavaScript代码,两个方法都包含有两个参数,第一个是将要执行的代码字符串,第二是以毫秒为单位的时间间隔,当过了这个时间间隔之后就会执行 ...

  8. php讲中文json数据编码

    <?php function show_jsonmsg($data){ if(is_array($data)){ $return = $data; }else{ $return = array( ...

  9. jq插件第二款来袭 图片滚动

    这第二款也是非常实用的插件,也是与图片相关,关于图片的需求太多了,这个是图片滚动哦,不过不是无缝滚动,是左像右滚动,到头的话再往回滚动,利用scrollLeft实现的,支持自动滚动和每次滚动的个数默认 ...

  10. python运维开发(十五)----JavaScript

    内容目录: HTML补充 javascript HTML补充 1.display标签 display的inline-block 属性会自动带3px的宽度 <span style="di ...