我想表明Loading.gif成我懸停的形象,我已經嘗試在CSS是這樣的:顯示加載GIF
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」)?
img:hover {background:url(../ images/loading.gif)no-repeat center center; } –