<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Title层</title>
<link href="css/blue.css" rel="stylesheet" type="text/css">
<style type="text/css">...
<!--
a{...}{
font-size:12px;
font-family: Tahoma;
text-decoration: none;
}
a:hover {...}{
text-decoration:underline;
}
-->
</style>
<script language=JavaScript>...
var isIE = document.all?true:false;
function overlib(tipcontent)
...{
customdiv = document.getElementById("overDiv");
customdiv.innerHTML = "<table width=150><tr><td>"+tipcontent+"</td></tr></table>";
var tleft=document.body.scrollLeft+window.event.clientX;
var ttop=document.body.scrollTop+window.event.clientY;
if(document.body.clientWidth < 300)
...{
customdiv.style.left = 2;
}
else if (tleft > document.body.clientWidth-200)
...{
customdiv.style.left = tleft-175;
}
else
...{
customdiv.style.left = tleft + 10;
}
if(document.body.clientHeight < 100)
...{
customdiv.style.top = 25;
}
else if(ttop > document.body.clientHeight -55)
...{
customdiv.style.top = ttop - 55;
}
else
...{
customdiv.style.top = ttop + 10;
}
customdiv.style.visibility = 'visible';
}
function nd()
...{
customdiv = document.getElementById("overDiv");
customdiv.style.visibility = 'hidden';
}

function b(v)...{window.status=v};
</script>
</head>
<body>
<div id="overDiv" style="position:absolute; visibility:hidden;border:1px solid #E3E3E3;z-index:1000;padding:2px;background:#FDFEF9;text-align:left;font-size:12px;"></div>
<div class="jingpaibBox" style=width:320px>
<p class="titurl" style=width:49%><a href='#' onMouseOver="return overlib('链接一内容...<br><font color=#3E82CD>http://www.hlj.net</font>');" onMouseOut="return nd();" target=_blank >链接一</a></p>
<p class="titurl" style=width:49%><a href='#' onMouseOver="return overlib('链接二内容...<br><font color=#3E82CD>http://www.hlj.net</font>');" onMouseOut="return nd();" target=_blank >链接二</a></p>
</div>
</body>
</html>
本文介绍了一个使用HTML和JavaScript实现的鼠标悬停显示提示信息的功能。通过自定义的CSS样式和JavaScript代码,可以在鼠标悬停于特定链接上时显示额外的信息,增强了用户体验。
3157

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



