判断td背景色问题 我做了个导航条 有onMouseOut,onMouseOver,onclick事件 就是换背景色 我想让onclick事件了以后onMouseOut就在此td失去效果 请高手指教 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $(document).ready(function(){ $("table tr td").mouseout(function() { $(this).css("background" ,"#ffffff"); });}); $(document).ready(function() { $("table tr td").mouseout(function() { $(this).css("background" ,"#ffffff"); }); });晕啊 请问这些都是什么意思啊?????学习一下========================================onMouseOut就在此td失去效果可以这么写吧:td.onmouseout = null; L@_@K<!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> <title> new document </title> <meta name="generator" content="editplus" /> <meta name="author" content="Gao YiXiang" /> <meta name="email" content="[email protected]" /> <meta name="keywords" content="javascript dhtml dom" /> <meta name="description" content="I love web development." /></head><body> <table border=1 width="100" height="100"> <tr> <td>1</td> <td>2</td> </tr> <tr> <td>3</td> <td>4</td> </tr> </table> <script type="text/javascript"> <!--var tds = document.getElementsByTagName("td");var td;var initColor = "#dddddd";for (var i=0; i<tds.length; i++){ td = tds[i]; td.style.backgroundColor = initColor; td.onmouseout = function() { this.style.backgroundColor = initColor; }; td.onmouseover = function() { this.style.backgroundColor = "#ffff00"; this.style.cursor = "hand"; }; td.onclick = function() { this.style.backgroundColor = "#ffffff"; this.onmouseover = null; this.onmouseout = null; };} //--> </script></body></html> 就如同http://www.sosuo8.com/more.asp?leibie=3 导航条一样 请帮下忙 你给的网站的导航条因该是根据leibie参数来是否给导航条加onmouseout,onmouseover处理函数的 (高分求)javaScript : 实现IE多页面跳转控制 innerHTML 如何加载<option> 预览功能如何实现??? 下面的JS代码,执行为什么提示安全警告,帮忙解决一下~~ 求一个正则表达式 请问JS如何监听键盘事件? 想在页面的表格上双击可以输入内容,回车后完毕 关于子窗口与父窗口传送数据的问题 怎样做到点击按钮,使按钮所在的页面有以下的属性? jQuery中函数的执行顺序问题,请高手帮看一下。 文件上传时为了弄个英文的浏览按钮,写了段程序,IE里可以,firefox里不行,为什么? 有两个脚本请大家帮看看
$(document).ready(function()
{
$("table tr td").mouseout(function()
{
$(this).css("background" ,"#ffffff");
});
});
{
$("table tr td").mouseout(function()
{
$(this).css("background" ,"#ffffff");
});
});
晕啊 请问这些都是什么意思啊?????学习一下
========================================onMouseOut就在此td失去效果
可以这么写吧:td.onmouseout = null;
<!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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="Gao YiXiang" />
<meta name="email" content="[email protected]" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
</head>
<body>
<table border=1 width="100" height="100">
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
</table>
<script type="text/javascript">
<!--
var tds = document.getElementsByTagName("td");
var td;
var initColor = "#dddddd";
for (var i=0; i<tds.length; i++)
{
td = tds[i];
td.style.backgroundColor = initColor;
td.onmouseout = function()
{
this.style.backgroundColor = initColor;
};
td.onmouseover = function()
{
this.style.backgroundColor = "#ffff00";
this.style.cursor = "hand";
};
td.onclick = function()
{
this.style.backgroundColor = "#ffffff";
this.onmouseover = null;
this.onmouseout = null;
};
}
//-->
</script>
</body>
</html>