<html>
<head>
<script language="javascript">
function dosome(obj)
{
obj.className = "a1"
}
</script>
<style type="text/css">
.a1 { color:#F00;}
.a1 a {text-decoration:none;color: #F00}
</style>
</head>
<body ><table width="546" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="546" onClick="dosome(this)">1</td>
</tr>
<tr>
<td width="546" onmouseover="dosome(this)"><a href = "163.com">2</a></td>
</tr>
</table>
</body>
</html>
<head>
<script language="javascript">
function dosome(obj)
{
obj.className = "a1"
}
</script>
<style type="text/css">
.a1 { color:#F00;}
.a1 a {text-decoration:none;color: #F00}
</style>
</head>
<body ><table width="546" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="546" onClick="dosome(this)">1</td>
</tr>
<tr>
<td width="546" onmouseover="dosome(this)"><a href = "163.com">2</a></td>
</tr>
</table>
</body>
</html>
解决方案 »
- 谁给解释一下,这是怎么回事
- 急急急~~求助——openlayers鼠标移位
- javascript在取checkbox时语句在Firefox不兼容
- 提问一个小问题,关于显示,隐藏的问题,谢谢大家
- 小问题在线等
- 在加载页面时,如何在页面中自动去掉(status,toolbar,menubar,scrollbars,location,titlebar)不用window.open()
- 请大虾帮我看看
- 请教:如何理解JS中的面向对象特征?(面向对象程序设计高手请进)
- 1.html中submit 2.html用target="_blank"方式,在2.html中用window.opener写第一个页面5.0怎中失败?6.0中好使
- body标签中的onload事件处理程序加载多个函数问题
- ASP中如何调用js脚本
- 帮忙看看这个联动菜单有什么问题 简单问题我不会~~~
a:hover{
color:red;
}
如果想让超联接每隔一秒变一次色,怎么做?
<head>
<script language="javascript">
var _st = window.setTimeout;
window.setTimeout = function(fRef,mDelay)
{
if(typeof fRef =="function")
{
var argu=Array.prototype.slice.call(arguments,2);
var f=(
function(){
fRef.apply(null, argu);
}
);
return _st(f,mDelay);
}
return _st(fRef,mDelay);
}
var flag=true;
function dosome(obj)
{
if(flag)
{
obj.className = "a2";
flag=false;
}
else
{
obj.className = "a1";
flag=true;
}
setTimeout(dosome,1000,obj);
}</script>
<style type="text/css">
.a1 { color:#F00;}
.a2 { color:#00F;}
.a1 a {text-decoration:none;color: #F00}
.a2 a {text-decoration:none;color: #00F}
</style>
</head>
<body ><table width="546" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="546" onClick="dosome(this)">1</td>
</tr>
<tr>
<td width="546" onmouseover="dosome(this)" onmouseout="NotDo()"><a href = "163.com" class=a1>2</a></td>
</tr>
</table>
</body>
</html>
<html>
<head>
<script language="javascript">
var _st = window.setInterval;
window.setInterval = function(fRef,mDelay)
{
if(typeof fRef =="function")
{
var argu=Array.prototype.slice.call(arguments,2);
var f=(
function(){
fRef.apply(null, argu);
}
);
return _st(f,mDelay);
}
return _st(fRef,mDelay);
}
var flag=true;
function dosome(obj)
{
if(flag)
{
obj.className = "a2";
flag=false;
}
else
{
obj.className = "a1";
flag=true;
}
}
function dosomedo(obj)
{
cf=setInterval(dosome,1000,obj);
}
function NotDo()
{
clearInterval(cf);
}</script>
<style type="text/css">
.a1 { color:#F00;}
.a2 { color:#00F;}
.a1 a {text-decoration:none;color: #F00}
.a2 a {text-decoration:none;color: #00F}
</style>
</head>
<body ><table width="546" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="546" onClick="dosome(this)">1</td>
</tr>
<tr>
<td width="546" onmouseover="dosomedo(this)" onmouseout="NotDo()"><a href = "163.com" class=a1>2</a></td>
</tr>
</table>
</body>
</html>
怎么传递了三个参数? 标准用法不是两个?var argu=Array.prototype.slice.call(arguments,2);
是什么意思
var argu=Array.prototype.slice.call(arguments,2);
对传进来的参数进行截断2个
Array.prototype.slice这句的意思是数组的截断函数而不是字符串的截断函数
call调用
arguments为参数对象
2截取几个
标准的用法是两个参数
上面说的“是三个”的意思是在这里是三个
:)
就是
var argu=Array.prototype.slice.call(数组—— dosome,1000); 吧那后面的obj干吗用,给function dosome(obj)当参数?怎么重载,苯,不大明白...