毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> WEB开发 >> 正文

如何判断当前鼠标是否在一个指定的元素上面? 第2页

更新时间:2012-9-26:  来源:毕业论文
HTML code
<!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>
    <title></title>

 <style type="text/css" >
 .subs{display:none;width:200px; background-color:Gray;}
</style>


</head>
<body>

<a id="item1" onmouseout="settimerhide()" onmouseover="itemover()" >menu</a>
 <div id="sub1" class="subs" onmouseout="settimerhide()" onmouseover="subsover()" >
 some sub text<br />
 some sub text<br />
 some sub text
  </div>
 
 <script type="text/javascript" >
     var timershow, timerhide;

     function itemover() {        
         if (timerhide) { window.clearInterval(timerhide); }
         if (document.getElementById("sub1").style.display != "block") {
             timershow = window.setTimeout("document.getElementById('sub1').style.display = 'block';", 200)
         }
     }

     function subsover() {
         if (timerhide) { window.clearInterval(timerhide); }    
      }
    
   

 function settimerhide() {
     timerhide = window.setTimeout("document.getElementById('sub1').style.display = 'none';", 200)
  }     
 </script>
 
</body>
</html>

上一页  [1] [2] 

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©chuibin.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。