Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript,jquery.panzoom,jquery:contain-issue_Javascript_Jquery - Fatal编程技术网

Javascript,jquery.panzoom,jquery:contain-issue

Javascript,jquery.panzoom,jquery:contain-issue,javascript,jquery,Javascript,Jquery,我真的很难让contain选项适用于jquery.panzoom 无论出于何种原因,我都无法在contain DIV的整个区域中拖动图像。这是我的使用示例 标记: <section id="contain"> <div class="panzoom-parent" style="overflow: hidden; position: relative;"> <img class="panzoom" src="h

我真的很难让contain选项适用于jquery.panzoom

无论出于何种原因,我都无法在contain DIV的整个区域中拖动图像。这是我的使用示例

标记:

    <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>

请帮忙

请尝试使用
禁用span:false

 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,
        disablePan: false,
        increment: 0.1,
        contain: true,                      
    }).panzoom('zoom', true);

});
这对我有用

 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,
        disablePan: false,
        increment: 0.1,
        contain: true,                      
    }).panzoom('zoom', true);

});