ie中点击shelect后失去onmouseover焦点的问题 javasconmouseoverselectie兼容 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你是怎么隐藏那个日历的层的,自己检查下相关代码,参考:jquery mouseleave事件:移动到子容器select的option上也会触发 IE开发人员工具,加入断点,启动调试,查看到哪里出现错误。firefox兼容性特强,但IE不是 <!DOCTYPE HTML><html><head><meta charset="utf-8"><title>无标题文档</title><style>#weather1{ width:30px; height:30px; background-color:#000;}#tq1{ width:300px; height:300px; background-color:#F00; position:absolute; top:50px; left:50px; display:none;}#weather{ width:30px; height:30px; background-color:#F00;}#tq { background-color:#fff; position:absolute; top:50px; left:50px; display:none;}</style><script>window.onload=function (){ var oDiv1=document.getElementById('weather'); var oDiv2=document.getElementById('tq'); var oDiv3=document.getElementById('weather1'); var oDiv4=document.getElementById('tq1'); var timer=null; oDiv2.onmouseover=oDiv1.onmouseover=function () { clearTimeout(timer); oDiv2.style.display='block'; }; oDiv2.onmouseout=oDiv1.onmouseout=function () { timer=setTimeout(function (){ oDiv2.style.display='none'; }, 200); }; var timer1=null; oDiv4.onmouseover=oDiv3.onmouseover=function () { clearTimeout(timer1); oDiv4.style.display='block'; }; oDiv4.onmouseout=oDiv3.onmouseout=function () { timer1=setTimeout(function (){ oDiv4.style.display='none'; }, 200); };};</script></head><body><div id="weather1"></div><div id="tq1"></div><div id="weather"></div><div id="tq"><table cellpadding="0" cellspacing="0" id="1"> <tr> <td><style> body,td,.p1,.p2,.i{font-family:arial}body{margin:6px 0 0 0;background-color:#fff;color:#000;}table{border:0}#cal{width:367px;border:1px solid #c3d9ff;font-size:12px;margin:0px 0 0 0px}#cal #top{height:29px;line-height:29px;background:#e7eef8;color:#003784;padding-left:42px}#cal #top select{font-size:12px}#cal #top input{padding:0}#cal ul#wk{margin:0;padding:0;height:25px}#cal ul#wk li{float:left;width:52px;text-align:center;line-height:25px;list-style:none}#cal ul#wk li b{font-weight:normal;color:#c60b02}#cal #cm{clear:left;border-top:1px solid #ddd;position:relative}#cal #cm .cell{position:absolute;width:36px;height:36px;text-align:center;margin:0 0 0 9px}#cal #cm .cell .so{font:bold 16px arial;}#cal #bm{text-align:right;height:24px;line-height:24px;padding:0 13px 0 0}#cal #bm a{color:7977ce}#cal #fd{display:none;position:absolute;border:1px solid #dddddf;background:#feffcd;padding:10px;line-height:21px;width:150px}#cal #fd b{font-weight:normal;color:#c60a00}</style><!--[if IE]><style>#cal #top{padding-top:4px}#cal #top input{width:65px}#cal #fd{width:170px}</style><![endif]--> <div id="cal"> <div id="top">公元 <select> </select> 年 <select> </select> 月 农历<span></span>年 [ <span></span>年 ] <input type="button" value="回到今天" title="点击后跳转回今天" style="padding:0px"> </div> <ul id="wk"> <li>一</li> <li>二</li> <li>三</li> <li>四</li> <li>五</li> <li><b>六</b></li> <li><b>日</b></li> </ul> <div id="cm"></div> </div></td> </tr></table></div> 那个年前面的select在mouseover出来日历后点击下,mouseouver就失去作用了。日历就消失了。 oDiv2.onmouseout = oDiv1.onmouseout = function () { if (document.all && window.event.toElement == null) return;//IE下移动到option对象上toElement为空,return取消下面代码执行 timer = setTimeout(function () { oDiv2.style.display = 'none'; }, 200); }; html中嵌入js为什么不能输出 div+js问题求助 仅下载当前屏图片技术如何实现? 帮我看看这段代码,错在哪?谢谢吭,答完给分。。。 onclick事件是触发能否判断是鼠标直接触发还是代码间接触发 再问:iframe 调用远程文件界面自适应高度 在javascript中是否可以插入java或jsp程序 请问一个iframe简单问题 超难问题:用脚本触发select元素的点击事件? 请教各位高手,学习JavaScipt应看什么书入门上手? 跪求如何让网页一次过展开表格里面全部的内容 DreamWever还有人用么?
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
#weather1{
width:30px;
height:30px;
background-color:#000;
}
#tq1{
width:300px;
height:300px;
background-color:#F00; position:absolute;
top:50px;
left:50px;
display:none;}
#weather{
width:30px;
height:30px;
background-color:#F00;
}
#tq {
background-color:#fff;
position:absolute;
top:50px;
left:50px;
display:none;}
</style>
<script>
window.onload=function ()
{
var oDiv1=document.getElementById('weather');
var oDiv2=document.getElementById('tq');
var oDiv3=document.getElementById('weather1');
var oDiv4=document.getElementById('tq1');
var timer=null;
oDiv2.onmouseover=oDiv1.onmouseover=function ()
{
clearTimeout(timer);
oDiv2.style.display='block';
};
oDiv2.onmouseout=oDiv1.onmouseout=function ()
{
timer=setTimeout(function (){
oDiv2.style.display='none';
}, 200);
};
var timer1=null;
oDiv4.onmouseover=oDiv3.onmouseover=function ()
{
clearTimeout(timer1);
oDiv4.style.display='block';
};
oDiv4.onmouseout=oDiv3.onmouseout=function ()
{
timer1=setTimeout(function (){
oDiv4.style.display='none';
}, 200);
};
};
</script>
</head><body>
<div id="weather1"></div>
<div id="tq1"></div>
<div id="weather"></div><div id="tq"><table cellpadding="0" cellspacing="0" id="1">
<tr>
<td><style>
body,td,.p1,.p2,.i{font-family:arial}
body{margin:6px 0 0 0;background-color:#fff;color:#000;}
table{border:0}
#cal{width:367px;border:1px solid #c3d9ff;font-size:12px;margin:0px 0 0 0px}
#cal #top{height:29px;line-height:29px;background:#e7eef8;color:#003784;padding-left:42px}
#cal #top select{font-size:12px}
#cal #top input{padding:0}
#cal ul#wk{margin:0;padding:0;height:25px}
#cal ul#wk li{float:left;width:52px;text-align:center;line-height:25px;list-style:none}
#cal ul#wk li b{font-weight:normal;color:#c60b02}
#cal #cm{clear:left;border-top:1px solid #ddd;position:relative}
#cal #cm .cell{position:absolute;width:36px;height:36px;text-align:center;margin:0 0 0 9px}
#cal #cm .cell .so{font:bold 16px arial;}
#cal #bm{text-align:right;height:24px;line-height:24px;padding:0 13px 0 0}
#cal #bm a{color:7977ce}
#cal #fd{display:none;position:absolute;border:1px solid #dddddf;background:#feffcd;padding:10px;line-height:21px;width:150px}
#cal #fd b{font-weight:normal;color:#c60a00}
</style>
<!--[if IE]>
<style>
#cal #top{padding-top:4px}
#cal #top input{width:65px}
#cal #fd{width:170px}
</style>
<![endif]-->
<div id="cal">
<div id="top">公元
<select>
</select>
年
<select>
</select>
月 农历<span></span>年 [ <span></span>年 ]
<input type="button" value="回到今天" title="点击后跳转回今天" style="padding:0px">
</div>
<ul id="wk">
<li>一</li>
<li>二</li>
<li>三</li>
<li>四</li>
<li>五</li>
<li><b>六</b></li>
<li><b>日</b></li>
</ul>
<div id="cm"></div>
</div></td>
</tr>
</table>
</div>
if (document.all && window.event.toElement == null) return;//IE下移动到option对象上toElement为空,return取消下面代码执行
timer = setTimeout(function () {
oDiv2.style.display = 'none';
}, 200);
};