您的位置:首页 > 其它

通过鼠标的移动来实现层的隐藏与显示

2014-12-02 09:46 232 查看
<html> <head> <title>Style Test</title> <script type="text/javascript" language="javascript"> function showTip(){ var oDiv=document.getElementById("divTip1"); oDiv.style.visibility="visible"; } function hideTip(){ var oDiv=document.getElementById("divTip1"); oDiv.style.visibility="hidden"; } </script> </head> <body> <p>Move your mouse over the red square</p> <div id="div1" style="background-color:red;height:50px;width:50px" onmouseover="showTip()" onmouseout="hideTip()"> </div> <div id="divTip1" style="background-color:green;position:absolute;visibility:hidden;padding:50px"> <span style="font-weight:bold">Custom Tooltip</span><br /> More details can go here. </div> </body></html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: