我正在使用elevateZoom.js預覽圖像。我在滑塊中隱藏的元素有問題。如何禁用懸停時預覽溢出隱藏的圖片。在這example,一切正常,但如果你將鼠標懸停在滑塊右側,你會看到隱藏圖片的預覽。是否有可能禁用此?elevateZoom禁用隱藏元素
的代碼是:
<!--Slider-->
<script type="text/javascript">
$(document).ready(function() {
$('#next').click(function(event) {
event.preventDefault();
$('#long-box').animate({scrollLeft:'+=706'}, 'slow');
});
$('#prev').click(function(event) {
event.preventDefault();
$('#long-box').animate({scrollLeft:'-=706'}, 'slow');
});
});
</script>
<!--Zoom-->
<script type="text/javascript">
$(document).ready(function() {
$('#sliding-windows').find("img").elevateZoom({
zoomType: "lens",
cursor: "crosshair",
zoomWindowFadeIn: 500,
zoomWindowFadeOut: 750
});
});
</script>
<div id="portfolio">
<div id="long-box-wrapper">
<div id="prev" class="button"></div>
<div id="next" class="button"></div>
<div id="long-box">
<div id="sliding-windows">
<img src="../irpex/img/portfolio_photos/small/1_small.jpg" data-zoom-image="../irpex/img/portfolio_photos/big/1_big.jpg">
<img src="../irpex/img/portfolio_photos/small/2_small.jpg" data-zoom-image="../irpex/img/portfolio_photos/big/2_big.jpg">
<img src="../irpex/img/portfolio_photos/small/3_small.jpg" data-zoom-image="../irpex/img/portfolio_photos/big/3_big.jpg">
</div>
</div>
</div>
</div>
而CSS是:
#long-box {
width: 702px;
margin: 16px auto 50px auto;
position: relative;
overflow: hidden;
}
#long-box-wrapper {
position: relative;
width: 700px;
margin: 0 auto;
}
#sliding-windows {
width: 4232px;
height: 933px;
overflow: hidden;
}
我想計數的元素,並且只適用於第8個元素懸停動作,滑塊點擊後接下來,應用懸停對於從8到8 + 8 = 16的元素。但我希望這不是最好的解決方案。 – kxc