大家好,又见面了,我是全栈君。
<script> window.onload = function(){ var oDiv1 = document.getElementById("div1"); var oDiv2 = document.getElementById("div2"); var timer = null; oDiv1.onmouseover = function () { clearTimeout(timer); oDiv2.style.display = "block"; } oDiv1.onmouseout = function(){ timer = setTimeout(function(){ oDiv2.style.display = "none"; }, 400); } oDiv2.onmouseover = function(){ clearTimeout(timer); this.style.display = "block"; } oDiv2.onmouseout = function(){ timer = setTimeout(function() { oDiv2.style.display = "none"; }, 400); } } </script>
转载于:https://www.cnblogs.com/bingxing/p/7678329.html
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/108104.html原文链接:https://javaforall.net