JS實(shí)現(xiàn)把鼠標(biāo)放到鏈接上出現(xiàn)滾動(dòng)文字的方法
本文實(shí)例講述了JS實(shí)現(xiàn)把鼠標(biāo)放到鏈接上出現(xiàn)滾動(dòng)文字的方法。分享給大家供大家參考,具體如下:
<div id="tooltip2" style="position:absolute;visibility:hidden;clip:rect(0 150 50 0);width:150px;background-color:seashell">
<layer name="nstip" width=1000px bgColor="seashell"></layer>
</div>
<SCRIPT language="JavaScript">
<!--
if (!document.layers&&!document.all)
event="test"
function showtip2(current,e,text){
if (document.all&&document.readyState=="complete"){
document.all.tooltip2.innerHTML='<marquee style="border:1px solid black">'+text+'</marquee>'
document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
document.all.tooltip2.style.visibility="visible"
}
else if (document.layers){
document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')
document.tooltip2.document.nstip.document.close()
document.tooltip2.document.nstip.left=0
currentscroll=setInterval("scrolltip()",100)
document.tooltip2.left=e.pageX+10
document.tooltip2.top=e.pageY+10
document.tooltip2.visibility="show"
}
}
function hidetip2(){
if (document.all)
document.all.tooltip2.style.visibility="hidden"
else if (document.layers){
clearInterval(currentscroll)
document.tooltip2.visibility="hidden"
}
}
function scrolltip(){
if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)
document.tooltip2.document.nstip.left-=5
else
document.tooltip2.document.nstip.left=150
}
//-->
</SCRIPT>
<a href=# onMouseOver="showtip2(this,event,'看到了吧?')" onMouseOut="hidetip2()">把鼠標(biāo)放上來試試</a>
更多關(guān)于JavaScript相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《JavaScript+flash技巧與特效大全》、《JavaScript切換特效與技巧總結(jié)》、《JavaScript查找算法技巧總結(jié)》、《JavaScript動(dòng)畫特效與技巧匯總》、《JavaScript錯(cuò)誤與調(diào)試技巧總結(jié)》、《JavaScript數(shù)據(jù)結(jié)構(gòu)與算法技巧總結(jié)》、《JavaScript遍歷算法與技巧總結(jié)》及《JavaScript數(shù)學(xué)運(yùn)算用法總結(jié)》
希望本文所述對(duì)大家JavaScript程序設(shè)計(jì)有所幫助。
相關(guān)文章
bootstrap實(shí)現(xiàn)圖片自動(dòng)輪播
這篇文章主要為大家詳細(xì)介紹了bootstrap實(shí)現(xiàn)圖片自動(dòng)輪播,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-12-12
代碼精簡(jiǎn)的可以實(shí)現(xiàn)元素圓角的js函數(shù)
代碼精簡(jiǎn)的可以實(shí)現(xiàn)元素圓角的js函數(shù)...2007-07-07
js實(shí)現(xiàn)點(diǎn)擊圖片將圖片地址復(fù)制到粘貼板的方法
這篇文章主要介紹了js實(shí)現(xiàn)點(diǎn)擊圖片將圖片地址復(fù)制到粘貼板的方法,涉及js操作節(jié)點(diǎn)的技巧,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2015-02-02
JavaScript基于ChatGPT實(shí)現(xiàn)打字機(jī)消息回復(fù)
ChatGPT 是一個(gè)基于深度學(xué)習(xí)的大型語言模型,處理自然語言需要大量的計(jì)算資源和時(shí)間,響應(yīng)速度肯定比普通的讀數(shù)據(jù)庫要慢的多,本文介紹了ChatGPT打字機(jī)消息回復(fù)實(shí)現(xiàn)原理,感興趣的同學(xué)可以跟著小編一起學(xué)習(xí)2023-05-05
JavaScript實(shí)現(xiàn)商品放大鏡效果

