1
我真的很掙扎包含選項爲jquery.panzoom工作。Javascript,jquery.panzoom,jQuery:包含問題
https://github.com/timmywil/jquery.panzoom
無論出於何種原因,我無法在整個包含DIV的整個區域拖動圖像。這是我使用的一個樣本。
http://dev.specialopswatch.com/products-page/predators/silver-predator/
標記:
<section id="contain">
<div class="panzoom-parent" style="overflow: hidden; position: relative;">
<img class="panzoom" src="http://dev.specialopswatch.com/wp-content/uploads/2014/06/SILVER-PREDATOR-400x4001.png" width="400" height="400" style="transform: matrix(0.5, 0, 0, 0.5, 0, 5); backface-visibility: hidden; transform-origin: 50% 50% 0px; cursor: move; transition: none; -webkit-transition: none;">
</div>
</section>
的Javascript:
jQuery(document).ready(function($) {
$section = $("#my-zoom");
var $panzoom = $section.find('.panzoom').panzoom({
$zoomIn: $section.find(".zoom-in"),
$zoomOut: $section.find(".zoom-out"),
$zoomRange: $section.find(".zoom-range"),
$reset: $section.find(".reset"),
startTransform: 'scale(0.95)',
maxScale: 1.3,
increment: 0.1,
contain: true,
}).panzoom('zoom', true);
});
請幫幫忙!