<html>
<script>
function showdiv()
{
var s=document.getElementById("sdiv");
s.style.display="inline";
}
function hiddiv()
{
var s=document.getElementById("sdiv");
s.style.display="none";
}
</script>
<body onload=hiddiv()>
<div id="sdiv" style="position:absolute;top:100;left:100;z-index:9999" >this is div</div>
<a href="" onmouseover="showdiv()" onmouseout="hiddiv()" >this is a div</a><br>
<a href="" onmouseover="window.open('http://www.microsoft.com/china/ ')" >http://www.microsoft.com/china/ </a>
</body>
</html>
<script>
function showdiv()
{
var s=document.getElementById("sdiv");
s.style.display="inline";
}
function hiddiv()
{
var s=document.getElementById("sdiv");
s.style.display="none";
}
</script>
<body onload=hiddiv()>
<div id="sdiv" style="position:absolute;top:100;left:100;z-index:9999" >this is div</div>
<a href="" onmouseover="showdiv()" onmouseout="hiddiv()" >this is a div</a><br>
<a href="" onmouseover="window.open('http://www.microsoft.com/china/ ')" >http://www.microsoft.com/china/ </a>
</body>
</html>
本文通过一个简单的HTML页面实例介绍了如何使用JavaScript来控制页面元素的显示与隐藏,并展示了带有鼠标悬停效果的链接操作及外部网站链接的直接打开方法。
3435

被折叠的 条评论
为什么被折叠?



