鼠标文字显示特效,当鼠标移动到文字上面时,显示预订的内容
运行效果:鼠标文字显示特效
代码如下:
<a href=# onmouseover = popup('测试数据内容','green'); onmouseout=kill();>测试</a>
<div id=dek class=dek></div>
<script type=text/javascript>
xoffset=-60;
yoffset= 20;
var nav,old,iex=(document.all),yyy=-1000;
if(navigator.appname==netscape){(document.layers)?nav=true:old=true;}
if(!old){
var skn=(nav)?document.dek:dek.style;
if(nav)document.captureevents(event.mousemove);
document.onmousemove=get_mouse;
}
function popup(msg,bak){
var content=<table border=0 bgcolor='red' cellpadding='3' cellspacing='1' ><td nowrap +
bgcolor=+bak+ align=left class=novdn>+ +msg+ +</td></table>;
if(old){alert(msg);return;}
else{yyy=yoffset;
if(nav){skn.document.write(content);skn.document.close();skn.visibility=visible}
if(iex){document.all(dek).innerhtml=content;skn.visibility=visible}
}
}
function get_mouse(e){
var x=(nav)?e.pagex:event.x+document.body.scrollleft;skn.left=x+xoffset+50;
var y=(nav)?e.pagey:event.y+document.body.scrolltop;skn.top=y+yyy;
}
function kill(){
if(!old){yyy=-1000;skn.visibility=hidden;}
}
</script>