javascript鼠标悬浮出现二维码

    xiaoxiao2021-12-14  15

    <div id="Layer1" style="display: none; position: absolute; z-index: 100;box-shadow: 6px 6px 4px #888888;"> </div> <li><a href="#" onmouseout="hiddenPic();" onmousemove="showPic(event,'assets/img/login_chat.png');">百度</a></li> <script language="javascript"> function showPic(e,sUrl){ var x,y; x = e.clientX; y = e.clientY; //此处图片出现位置可自行调整 document.getElementById("Layer1").style.left = x-70+'px'; document.getElementById("Layer1").style.top = y-175+'px'; document.getElementById("Layer1").innerHTML = "<img border='0' width='140px' height='140px' src=\"" + sUrl + "\">"; document.getElementById("Layer1").style.display = ""; } function hiddenPic(){ document.getElementById("Layer1").innerHTML = ""; document.getElementById("Layer1").style.display = "none"; } </script>
    转载请注明原文地址: https://ju.6miu.com/read-964501.html

    最新回复(0)