自己写的模仿163邮箱的提示,出现错误! 与你这hide()函数有关,重点检查下这函数; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 if(obj.filters.alpha.opacity<=0) { ClearTimeout(t.timer1);////////clearTimeout是小写 obj.style.display="none"; http://blog.never-online.net/article.asp?id=22 function hide(){ obj = document.all.ly; window.status = "hide"+obj.filters.alpha.opacity; if(obj.filters.alpha.opacity<0)这里如果obj.filters.alpha.opacity<=0,就会出现2次循环,如果是<0就不会。不过也会需要点2次的,在第一次show运行完毕后,状态栏显示为show100而点确定的时候却是hide100,再点一次才开始逐渐的隐藏。为何是这样呢?想不明白 { clearTimeout(t.timer1); obj.style.display="none"; return; } else { obj.filters.alpha.opacity-=2; t.timer1=setTimeout("hide()",1) return; } } 贴出答案,自己解决<html><head></head><body> <script>var t=new Object();var strdo ="";var ishide = false;function show(){ clearTimeout(t); obj = document.all.ly; obj.style.display="block"; window.status = "show"+obj.filters.alpha.opacity; obj.style.width=document.body.clientWidth; obj.style.height=document.body.clientHeight; if(obj.filters.alpha.opacity>100){ clearTimeout(t); obj.filters.alpha.opacity=100; return; }else{ obj.filters.alpha.opacity+=2; t=setTimeout("show()",1) return; } } function hide(){ obj = document.all.ly; clearTimeout(t); window.status = "hide"+obj.filters.alpha.opacity; if(obj.filters.alpha.opacity<0) { clearTimeout(t); obj.style.display="none"; obj.filters.alpha.opacity = 0; return; } else { obj.filters.alpha.opacity-=2; t=setTimeout("hide()",1) return; } }function f_add(){ hide(); } </script> <input type="button" value="显示" onclick="show()"><div id="ly" style="position: absolute; top: 0px; filter: alpha(opacity=0); background-color: #f;z-index: 9999; left: 0px; display:block;"><div id="ly2" align="center" style="position: absolute; z-index: 99999;width:expression(document.all.tb_msg.clientWidth); height:expression(document.all.tb_msg.clientHeight-80);left: expression((document.body.offsetWidth-document.all.tb_msg.offsetWidth)/2);top:expression((document.body.offsetHeight-document.all.tb_msg.offsetHeight)/2);bac kground-color: #fff;"><table width="340" id="tb_msg" border="1" cellpadding="0" cellspacing="0" style="border: 1px solid #e7e3e7; border-collapse: collapse;"><tr><td style="background-color: #73A2d6; color: #fff; padding-left: 4px; padding-top: 2px;font-weight: bold; font-size: 14px;" height="27" >[数据保存]</td></tr><tr style="padding:4px;height:50px"><td align="center">保存成功</td></tr><tr><td style="background-color: #f7f7f7;" height="30" align="center" ><input type="button" value="新增" onclick="f_add()"/> <input type="button" value="编辑记录" onclick="f_modify()"/> <input type="button" value="退出" onclick="hide()"/></td></tr></table></div></div> </body></html> 新手求ExtJs学习方式 history的用法 如何动态生成文本框,也可以删除! 按回车submit按钮就提交,请问怎样禁止? 各位帮帮忙谢谢 js文本框的问题 两段JS代码冲突,求解决 jQuery EasyUI1.2.6 Demo的问题 父窗口传递参数的问题,在线等,谢谢 下拉菜单中能实现“Alt”效果吗? 怎么样用最简单的脚本控制div层的显示隐含! 做网络统计时遇到的奇怪问题 meizz请进,Mztree问题
{
ClearTimeout(t.timer1);////////clearTimeout是小写
obj.style.display="none";
obj = document.all.ly;
window.status = "hide"+obj.filters.alpha.opacity;
if(obj.filters.alpha.opacity<0)
这里如果obj.filters.alpha.opacity<=0,就会出现2次循环,如果是<0就不会。不过也会需要点2次的,在第一次show运行完毕后,状态栏显示为show100而点确定的时候却是hide100,再点一次才开始逐渐的隐藏。为何是这样呢?想不明白
{
clearTimeout(t.timer1);
obj.style.display="none";
return;
}
else
{
obj.filters.alpha.opacity-=2;
t.timer1=setTimeout("hide()",1)
return;
}
}
<html>
<head>
</head>
<body> <script>
var t=new Object();
var strdo ="";
var ishide = false;
function show(){
clearTimeout(t);
obj = document.all.ly;
obj.style.display="block";
window.status = "show"+obj.filters.alpha.opacity;
obj.style.width=document.body.clientWidth;
obj.style.height=document.body.clientHeight;
if(obj.filters.alpha.opacity>100){
clearTimeout(t);
obj.filters.alpha.opacity=100;
return;
}else{
obj.filters.alpha.opacity+=2;
t=setTimeout("show()",1)
return;
}
}
function hide(){
obj = document.all.ly;
clearTimeout(t);
window.status = "hide"+obj.filters.alpha.opacity;
if(obj.filters.alpha.opacity<0)
{
clearTimeout(t);
obj.style.display="none";
obj.filters.alpha.opacity = 0;
return;
}
else
{
obj.filters.alpha.opacity-=2;
t=setTimeout("hide()",1)
return;
}
}function f_add()
{
hide();
}
</script> <input type="button" value="显示" onclick="show()">
<div id="ly" style="position: absolute; top: 0px; filter: alpha(opacity=0); background-color: #f;z-index: 9999; left: 0px; display:block;"><div id="ly2" align="center" style="position: absolute; z-index: 99999;width:expression(document.all.tb_msg.clientWidth); height:expression(document.all.tb_msg.clientHeight-80);left: expression((document.body.offsetWidth-document.all.tb_msg.offsetWidth)/2);top:expression((document.body.offsetHeight-document.all.tb_msg.offsetHeight)/2);bac kground-color: #fff;"><table width="340" id="tb_msg" border="1" cellpadding="0" cellspacing="0" style="border: 1px solid #e7e3e7; border-collapse: collapse;"><tr><td style="background-color: #73A2d6; color: #fff; padding-left: 4px; padding-top: 2px;font-weight: bold; font-size: 14px;" height="27" >[数据保存]</td></tr><tr style="padding:4px;height:50px"><td align="center">保存成功</td></tr><tr><td style="background-color: #f7f7f7;" height="30" align="center" ><input type="button" value="新增" onclick="f_add()"/> <input type="button" value="编辑记录" onclick="f_modify()"/> <input type="button" value="退出" onclick="hide()"/></td></tr></table></div></div>
</body>
</html>