jquery - 将缩略图加载到 Div 中并使用 cloud-zoom

标签 jquery cloud zooming

我在将缩略图加载到 div 中然后使用云缩放时遇到问题,基本上 html 是这样的:

<!-- The Original Image -->
<p class="product-image product-image-zoom replace">
<a class="cloud-zoom" id="zoom1" href="src/to/img.jpg" rel="adjustX: 10, adjustY:-4">
<img id="" src="src/to/img.jpg" />
</a>
</p>


<div class="more-views">
   <ul>
    <li>
        <a href=""><img class="image-rollover" src="source/to/img.jpg" width="67" height="67"/></a>
    </li>
     <li>
        <a href=""><img class="image-rollover" src="source/to/img.jpg" width="67" height="67"/></a>
    </li>
     <li>
        <a href=""><img class="image-rollover" src="source/to/img.jpg" width="67" height="67"/></a>
    </li>
</ul>

这是我用来将每个缩略图加载到主 img 标签中的 jquery:

jQuery('.image-rollover').hover(function() {
jQuery('.replace img').attr("src", this.src);
jQuery('.zoom').attr("href", this.src);
});

我还在主图像上使用云缩放:

<script type="text/JavaScript" src="<?php echo $this->getSkinUrl('js/cloud-zoom.1.0.2.min.js') ?>"></script>

所以这是我的问题:缩略图可以加载到 div 中,但是每次我将鼠标悬停在新加载的缩略图上时,都会出现云缩放,但仍然显示初始图像,有没有办法获得云缩放以显示当前加载的图像?

a busy cat http://beta2.stocksale.ca/picture.png

请帮忙!!!啊啊啊!!!

最佳答案

只需在 jQuery 操作后重新调用 *$('.cloud-zoom, .cloud-zoom-gallery').CloudZoom();* 即可。

关于jquery - 将缩略图加载到 Div 中并使用 cloud-zoom,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10639741/

相关文章:

javascript - jQuery UI 如何创建其精确复制的绝对定位拖动助手?

python - 返回 3D scipy.spatial.Delaunay 的表面三角形

ios - iOS 中的语义缩放

javascript - 如何使 jquery 模态始终位于页面中央?

javascript - JQuery 无法解析 json_encode 创建的 JSON 字符串

javascript - 如何在 jquery AJAX 响应中附加复选框中的值

json - 使用 ARM 模板和 JSON 在 Azure 中创建 VM 时出现 "DiskImageNotReady"错误

mongodb - 如何在 IBM blue mix 中为 asp .net 应用程序添加引用 dll?

python - 照片图像缩放

css - 100% 高度 vs 浏览器缩放