简单教程
提交运行
代码编辑器:
<img onmouseenter="bigImg(this)" onmouseleave="normalImg(this)" border="0" src="/static/i/img3.jpg" alt="Smiley" width="32" height="32"> <p> bigImg() 函数在用户将鼠标指针移动到该图像时触发</p> <p> normalImg() 函数在用户将鼠标指针移出图像时触发</p> <script> function bigImg(x) { x.style.height = "64px"; x.style.width = "64px"; } function normalImg(x) { x.style.height = "32px"; x.style.width = "32px"; } </script>
运行结果: