鼠標放到鏈接上就會出現一個說明框裡面有滾動的文字說明
代碼是:
<a _blank onMouseOver=helpor_net_show(thisevent看到了吧?) onMouseOut=helpor_net_hide()>把鼠標放上來試試</a>
<div id=tooltip >
<layer name=nstip width=px bgColor=seashell></layer>
</div>
<SCRIPT language=JavaScript>
<!
if (!documentlayers&&!documentall)
event=test
function helpor_net_show(currentetext){
if (documentall&&documentreadyState==complete){
documentalltooltipinnerHTML=<marquee >+text+</marquee>
documentalltooltipstylepixelLeft=eventclientX+documentbodyscrollLeft+
documentalltooltipstylepixelTop=eventclientY+documentbodyscrollTop+
documentalltooltipstylevisibility=visible
}
else if (documentlayers){
documenttooltipdocumentnstipdocumentwrite(<b>+text+</b>)
documenttooltipdocumentnstipdocumentclose()
documenttooltipdocumentnstipleft=
currentscroll=setInterval(scrolltip())
documenttooltipleft=epageX+
documenttooltiptop=epageY+
documenttooltipvisibility=show
}
}
function helpor_net_hide(){
if (documentall)
documentalltooltipstylevisibility=hidden
else if (documentlayers){
clearInterval(currentscroll)
documenttooltipvisibility=hidden
}
}
function scrolltip(){
if (documenttooltipdocumentnstipleft>=documenttooltipdocumentnstipdocumentwidth)
documenttooltipdocumentnstipleft=
else
documenttooltipdocumentnstipleft=
}
//>
</SCRIPT>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19697.html