熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

javascript控制的鼠標特效

2022-06-13   來源: JSP教程 

  鼠標放到鏈接上就會出現一個說明框裡面有滾動的文字說明

  代碼是:
<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
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.