JS使用oumousemove和oumouseout動態(tài)改變圖片顯示的方法
更新時間:2015年03月31日 15:22:40 作者:歐陽不瘋
這篇文章主要介紹了JS使用oumousemove和oumouseout動態(tài)改變圖片顯示的方法,涉及javascript鼠標事件及圖片操作技巧,具有一定參考借鑒價值,需要的朋友可以參考下
本文實例講述了JS使用oumousemove和oumouseout動態(tài)改變圖片顯示的方法。分享給大家供大家參考。具體如下:
鼠標放到圖片上時圖片會自動變大,鼠標離開圖片還原
<!DOCTYPE html> <html> <head> <script> function bigImg(x) { x.style.height="64px"; x.style.width="64px"; } function normalImg(x) { x.style.height="32px"; x.style.width="32px"; } </script> </head> <body> <img onmouseover="bigImg(this)" onmouseout="normalImg(this)" border="0" src="smiley.gif" alt="Smiley" width="32" height="32"> <p>The function bigImg() is triggered when the user moves the mouse pointer over the image.</p> <p>The function normalImg() is triggered when the mouse pointer is moved out of the image.</p> </body> </html>
希望本文所述對大家的javascript程序設計有所幫助。
相關文章
基于JavaScript實現(xiàn)簡單抽獎功能代碼實例
這篇文章主要介紹了基于JavaScript實現(xiàn)簡單抽獎功能代碼實例,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友可以參考下2020-10-10JavaScript函數(shù)及其prototype詳解
這篇文章主要介紹了JavaScript函數(shù)及其prototype詳解的相關資料,需要的朋友可以參考下2023-03-03ibm官方資料把應用程序從 Internet Explorer 遷移到 Mozilla
使特定于 Internet Explorer 的 Web 應用程序在 Mozilla 上運行時,您遇到過麻煩嗎?本文討論了將應用程序遷移到基于開源 Mozilla 瀏覽器上時的常見問題。首先討論跨瀏覽器開發(fā)的基本技術,然后介紹克服 Mozilla 和 Internet Explorer 之間差異的策略。2008-04-04JavaScript的DOM與BOM的區(qū)別與用法詳解
這篇文章主要為大家詳細介紹了JavaScript的DOM與BOM的區(qū)別與用法,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下,希望能夠給你帶來幫助2022-03-03