(转)鼠标移动到标题上就显示提示(onmouseover)

<STYLE type=text/css>BODY {
 OVERFLOW: scroll; OVERFLOW-X: hidden
}
.DEK {
 POSITION: absolute; VISIBILITY: hidden; Z-INDEX: 200
}
A.js:link {
 COLOR: #ff0000; LINE-HEIGHT: 120%; TEXT-DECORATION: none
}
A.js:visited {
 COLOR: #ff0000; LINE-HEIGHT: 120%; TEXT-DECORATION: none
}
A.js:hover {
 COLOR: #ff3300; LINE-HEIGHT: 120%; TEXT-DECORATION: underline
}
A.js:active {
 COLOR: #ff3300; LINE-HEIGHT: 120%; TEXT-DECORATION: underline
}
</STYLE>


<center>
<TABLE border=0 cellPadding=0 cellSpacing=0 height="42%" width="36%">
  <TBODY>
  <TR>
    <TD align=middle><BR>
      <DIV class=dek id=dek style="left: 67px; top: 66px; width: 289px; height: 17px"></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 WIDTH=150 BORDER=1 BORDERCOLOR=black CELLPADDING=2 CELLSPACING=0 "+
"BGCOLOR="+bak+"><TD ALIGN=center><FONT COLOR=black SIZE=2>"+msg+"</FONT></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;
var y=(nav)?e.pageY:event.y+document.body.scrollTop;skn.top=y+yyy;
}

function kill(){
if(!old){yyy=-1000;skn.visibility="hidden";}
}
</SCRIPT>
      <A href="#" onmouseout=kill()
      onmouseover="popup('这里是链接一的提示<br>可以定义不同的背景颜色以及链接等等','lightgreen')"
      ;>演示链接一</A> <A href="#" onmouseout=kill()
      onmouseover="popup('这里是链接二的提示<br>可以定义不同的背景颜色以及链接等等','lightblue')"
      ;>演示链接二</A></TD>
  </TR></TBODY></TABLE>

posted @ 2006-08-20 22:56  阿东hd  阅读(1329)  评论(0编辑  收藏  举报