我希望你能在鼠标悬浮时显示Loading.gif图像,我已经尝试使用css,像这样:
当我悬停在缩略图上时,我希望将loading.gif显示到.detailimage img(“主要图像”)中。
如何将该jQuery添加到我的最新jQuery中?.show(".load")?
img {background:url(../images/loading.gif) no-repeat center center; }
这对于所有的图片来说都很好,但是在我鼠标悬停的那张图片上不起作用。
所以,尝试添加一个div。
<div class="load"></div>
.load {background:url(../images/loading.gif) no-repeat center center; }
<div class="detailimage">
<img class="mainimage" src="<?php echo $base; ?>/img.php?w=600&h=600&img=images/<?php echo $datadetailproduct['images']; ?>" />
<ul>
<?php
while ($datadetailthumb = mysqli_fetch_assoc($detailthumb)) {
?>
<li>
<img src="<?php echo $base; ?>/img.php?w=75&h=75&img=images/<?php echo $datadetailthumb['thumb']; ?>" />
</li>
<?php } ?>
</ul>
</div>
这是我的jQuery
$(".detailimage li img").hover(function(){
$(".mainimage").attr("src",$(this).attr("src").replace("img.php?w=75&h=75&img=images/", "img.php?w=600&h=600&img=images/"));
});
当我悬停在缩略图上时,我希望将loading.gif显示到.detailimage img(“主要图像”)中。
如何将该jQuery添加到我的最新jQuery中?.show(".load")?