我正在使用 JQuery Zoom 作为图像查看器。单击图像时图像会缩放。 我想让变焦变得顺利。我该怎么做?
代码:
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script>
<script src='js/jquery.zoom.js'></script>
<script>
$(document).ready(function(){
$('#ex4').zoom({ on:'toggle' });
});
</script>
html
<div class="zoom" id="ex4">
<img src="images/element.jpg"/>
</div>
最佳答案
您可以使用duration
选项,这样缩放效果会花费更多时间并且看起来更平滑。
引用:
duration 120 The fadeIn/fadeOut speed of the large image.
代码:
$(document).ready(function () {
$('#ex1').zoom({
on: 'toggle',
duration: 1000
});
});
关于javascript - jquery如何让缩放变得平滑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21276887/