简体   繁体   English

检测图像变化事件

[英]detect image change event

如果将鼠标悬停在缩略图上,如何检测更改,主图像将替换为缩略图,我相信onLoad()只会触发一次。

If i understand you correctly : 如果我正确理解你:

Use onmouseover . 使用onmouseover onload is a document event handler. onload是一个文档事件处理程序。

<img src="images/oldImage.jpg" onmouseover="this.src='images/newImage.jpg'; alert("Mouse detected over thumbnail.  New fullsize Image Loaded!");>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM