我在彩色框内使用了从此网站https://github.com/timmywil/jquery.panzoom
中提取的jquery panzoom。缩放选项在颜色框内不起作用。如果我将它放在弹出窗口之外它工作正常。如何解决这个问题?
内部脚本:
<script>
$("#panzoom").panzoom({
$zoomIn: $(".zoom-in"),
$zoomOut: $(".zoom-out"),
$zoomRange: $(".zoom-range"),
$reset: $(".reset")
});
</script>
HTML:
<section>
<div id="panzoom" style="text-align: center">
<img src="http://blog.millermedeiros.com/wp-content/uploads/2010/04/awesome_tiger.svg" width="300" height="300">
</div>
</section>
<button class="zoom-in">Zoom In</button>
<button class="zoom-out">Zoom Out</button>
<input type="range" class="zoom-range">
<button class="reset">Reset</button>
答案 0 :(得分:0)
试试这个
$('selector').colorbox(inline:true,onComplete:function(){
$("#panzoom").panzoom({
$zoomIn: $(".zoom-in"),
$zoomOut: $(".zoom-out"),
$zoomRange: $(".zoom-range"),
$reset: $(".reset")
});
}
});