javascript簡單實(shí)現(xiàn)類似QQ頭像彈出效果的方法
更新時(shí)間:2015年08月03日 09:33:15 作者:106444269
這篇文章主要介紹了javascript簡單實(shí)現(xiàn)類似QQ頭像彈出效果的方法,可實(shí)現(xiàn)簡單的頁面元素彈出效果,具有一定參考借鑒價(jià)值,需要的朋友可以參考下
本文實(shí)例講述了javascript簡單實(shí)現(xiàn)類似QQ頭像彈出效果的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>簡單的類似QQ頭像的彈出效果</title> <style type="text/css"> #oimg{float:left; margin:10px} #msg{border:solid; width:300px;height:250px;display:none;float:left;padding:10px} </style> </head> <body> <img id="oimg" src="images/show.jpg" /> <div id="msg">啦啦啦啦。。。。。</div> <script type="text/javascript"> var oid=document.getElementById('oimg'); var omsg=document.getElementById('msg'); var timer=null; oid.onmousemove=showMsg; oid.onmouseout=hideMsg; omsg.onmouseout=hideMsg; omsg.onmousemove=function(){clearTimeout(timer)}; function showMsg(){if(timer){clearTimeout(timer)}omsg.style.display='block';} function hideMsg(){timer=setTimeout(function(){omsg.style.display='none';},500);} </script> </body> </html>
希望本文所述對大家的javascript程序設(shè)計(jì)有所幫助。
相關(guān)文章
Typescript高級類型Record,Partial,Readonly詳解
這篇文章主要介紹了Typescript高級類型Record,Partial,Readonly等介紹,keyof將一個(gè)類型的屬性名全部提取出來當(dāng)做聯(lián)合類型,本文通過實(shí)例代碼給大家詳細(xì)講解需要的朋友可以參考下2022-11-11javascript從右邊截取指定字符串的三種實(shí)現(xiàn)方法
這篇文章主要介紹了javascript從右邊截取指定字符串的三種實(shí)現(xiàn)方法。需要的朋友可以過來參考下,希望對大家有所幫助2013-11-11JavaScript知識點(diǎn)總結(jié)(四)之邏輯OR運(yùn)算符詳解
這篇文章主要介紹了JavaScript知識點(diǎn)總結(jié)(四)之邏輯OR運(yùn)算符詳解的相關(guān)資料,在JavaScript中,邏輯OR運(yùn)算符用||表示。本文介紹的非常詳細(xì),具有參考借鑒價(jià)值,感興趣的朋友一起看看吧2016-05-05