JavaScript 鼠标移动切换图片

Posted on 2010-05-21 22:24  严武  阅读(1639)  评论(1编辑  收藏  举报

<title>JavaScript切换图片</title>
<script>
function showDaTu(src){
document.getElementById("defaultImg").src=src;
}
</script>
<img src="/jscss/demoimg/wall1.jpg" id="defaultImg">
<br><br><br>
<img src='/jscss/demoimg/wall_s1.jpg' onmouseover="showDaTu('/jscss/demoimg/wall1.jpg')">
<img src='/jscss/demoimg/wall_s2.jpg' onmouseover="showDaTu('/jscss/demoimg/wall2.jpg')">
<img src='/jscss/demoimg/wall_s3.jpg' onmouseover="showDaTu('/jscss/demoimg/wall3.jpg')">
<img src='/jscss/demoimg/wall_s4.jpg' onmouseover="showDaTu('/jscss/demoimg/wall4.jpg')">
<br>因图片较大,请等待图片加载完成……然后鼠标放小图上就会切换了。

Copyright © 2024 严武
Powered by .NET 9.0 on Kubernetes