【发布时间】:2015-06-05 18:21:45
【问题描述】:
我正在使用此处找到的脚本:
Automatically load an image using javascript
我正在使用它们构建图像库,其中主图像在mouseenter 上加载缩略图图像,但我的主图像开始空白,而不是答案中的第一个缩略图。我需要知道如何将每个缩略图的mouseout 上的主图像清除回空白?
【问题讨论】:
标签: javascript image gallery
我正在使用此处找到的脚本:
Automatically load an image using javascript
我正在使用它们构建图像库,其中主图像在mouseenter 上加载缩略图图像,但我的主图像开始空白,而不是答案中的第一个缩略图。我需要知道如何将每个缩略图的mouseout 上的主图像清除回空白?
【问题讨论】:
标签: javascript image gallery
像这样尝试 JQuery .mouseout():
$('.thumbnails img').mouseout(function () {
this.src = '';
});
单击http://jsfiddle.net/cnx65ev0/ 以查看它正在运行。将鼠标悬停在图像上,当您离开它们时,它们将变为空白。我希望这是你想要的。
【讨论】: