专注前端素材!
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>素材8网教程(study.sucai8.cn)</title> <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 onmousemove="bigImg(this)" onmouseout="normalImg(this)" border="0" src="smiley.gif" alt="Smiley" width="32" height="32"> <p>当用户将鼠标移动到图片时触发 bigImg() 函数。该函数使图片变大。</p> <p>当用户将鼠标移开时触发normalImg() 函数。该函数使图片变回原来大写。</p> </body> </html>
运行结果