宇宙射线强度:请教一个关于HTML的问题

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/01 07:29:28
我想做一个用鼠标在文字上滑过就有提示的效果。

就如同新浪天气预报上面“看图查询”的部分(http://weather.sina.com.cn/


<div id="tip" style="position:relative;background:#CCFFFF;border:solid 1px #999999;display:none" />

<script language="javascript">
function showtip(tipStr){
document.all.tip.innerHTML=tipStr;
document.all.tip.style.left=window.event.offsetX+20;
document.all.tip.style.top=window.event.offsetY;
document.all.tip.style.display="";
}
function movetip(){
document.all.tip.style.left=window.event.offsetX+20;
document.all.tip.style.top=window.event.offsetY;
}
function hidetip(){
document.all.tip.style.display="none";
}
</script>

<a HREF="javascript:window.open()" onmouseover="showtip('备注内容');" onmouseout="hidetip();" onmousemove="movetip();">文字</a>

可是运行时这个提示框却并不在鼠标的位置,而是当我移动滚动条后也随之跑了,谁能帮我解决么?

这个可能要在专业的网页设计软件才能找到,比如MICROSOFT网页,你把你的资料打上去很容易就找到答案的,不妨试试看!

上网站查啊!很容易的!