qq头像

2016-12-02  本文已影响0人  编程师小刘
<style>

#box{

width:100px;

height: 100px;

background: yellow;

}

#box2{

width: 300px;

height: 300px;

background: fuchsia;

position: absolute;

left:120px;

top:8px;

display: none;

}

</style>

<script>

window.onload=function(){

var oBox=document.getElementById('box');

var oBox2=document.getElementById('box2');

var timer;

oBox.onmouseover=function(){

clearTimeout(timer);

oBox2.style.display='block';

};

oBox.onmouseout=function(){

timer=setTimeout(function(){

oBox2.style.display='none';

},600)

};

oBox2.onmouseover=function(){

clearTimeout(timer);

oBox2.style.display='block';

};

oBox2.onmouseout=function(){

timer=setTimeout(function(){

oBox2.style.display='none';

},600)

};

};

</script>
上一篇 下一篇

猜你喜欢

热点阅读