<!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> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>javascript div mouseout-hidden-zone</title> <script> if(typeof(HTMLElement)!="undefined") { HTMLElement.prototype.contains=function(obj) { while(obj!=null&&typeof(obj.tagName)!="undefind"){ if(obj==this) return true; obj=obj.parentNode; } return false; }; } function hideDiv(e,o){ var o=o; if(!e)var e=e||window.event; var relTarg=e.relatedTarget||e.toElement; if ((relTarg!=null)){ if (o.contains(relTarg)) { return; } o.style.display='none'; } } function showDiv(o){ o.style.display='block' } </script> <style> #test{ margin:0 auto; background-color:#999999; width:200px; height:300px; } </style> </head> <body> <div id="test" style="" onmouseover="showDiv(this)" onmouseout="hideDiv(event,this)"> <select> <option>aaa</option> <option>bbb</option> <option>ccc</option> <option>ddd</option> </select> </div> </body> </html>
提示:你可以先修改部分代码再运行。
还没有评论内容哦,快快提交您的评论,坐上沙发!
昵称 (必填)
邮箱 (不会出现在评论中) (必填)
您的网站地址(有空必登网拜访)
XHTML: 您可以使用以下标签 <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
取消回复
用户名:
密 码:
记住密码