setTimeout()函数的使用? setTimeout只是在计时结束是调用一个函数.你为什么不用一个算法来确定setTimeout的时间值呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用作参考<html><head><title> New Document </title><script>var opa = 20;var tm;var curobj;function Show(obj){ curobj = obj; filterShow();}function filterShow(){ if(curobj==null)return; opa+=2; if(opa==102)opa=100; curobj.style.filter="alpha(opacity=" + opa + ",style=0)"; tm = setTimeout(filterShow,20);}function resetFilter(obj){ curobj=null; opa=20; obj.style.filter="alpha(opacity=20,style=0);"}</script></head><body><img src=abc.gif onmouseover="Show(this)" onmouseout="resetFilter(this)" style="filter:alpha(opacity=20,style=0)"></body></html> 谢谢各位,昨晚已经把程序基本实现了,方法和军仔的差不多,关键是函数应该递归调用,也就是循环子的放置位置,把函数放在FOR循环中达不到效果,想了一下原因,用递归实现可以保证循环子起到正确的作用,而在FOR循环中,由于SETITMEOUT函数要等一定的时间后才会执行,这时循环子已经达到最大值了,也就无法实现渐变的效果了。 关于Ext,对象为空,或不是对象的问题。 jquery 遍历 对象数组 问题 web JavaScript 调用hce-302的com struts2.0和javascript问题 JavaScript文本框中内容为什么不能显示出来 关于javasript的问题~ cookie文本中以下自带的内容大概是什么意思?? 一个关于坐标的问题 关于window.open 我就移动了一下项目 java就报数据库错误 大佬们帮忙看一下 回车换行的问题 about form evaluation
<html>
<head>
<title> New Document </title>
<script>
var opa = 20;
var tm;
var curobj;
function Show(obj){
curobj = obj;
filterShow();}function filterShow(){
if(curobj==null)return;
opa+=2;
if(opa==102)opa=100;
curobj.style.filter="alpha(opacity=" + opa + ",style=0)";
tm = setTimeout(filterShow,20);}function resetFilter(obj){
curobj=null;
opa=20;
obj.style.filter="alpha(opacity=20,style=0);"}
</script>
</head><body>
<img src=abc.gif onmouseover="Show(this)" onmouseout="resetFilter(this)" style="filter:alpha(opacity=20,style=0)">
</body>
</html>