gpt4 book ai didi

javascript - Panzoom - 如何禁用拖动选项?

转载 作者:行者123 更新时间:2023-11-27 23:50:30 28 4
gpt4 key购买 nike

在rails 4.2.2项目中,我使用panzoom jquery作为html元素(而不是图像),对于同一页面我使用annotator插件。现在的问题是注释器无法工作,因为我无法选择页面中的任何单词。由于 panzoom,整个 html 正在移动(拖动),如何禁用其中的“拖动”选项?

推荐人http://www.jqueryscript.net/zoom/jQuery-Plugin-For-Panning-Zooming-Any-Elements-panzoom.html

在 View 中,

<div class="buttons">
<button class="zoom-in btn btn-default btn-xs">+ Zoom In</button>
<button class="zoom-out btn btn-default btn-xs">- Zoom Out</button>
<button class="reset btn-sm btn btn-primary">Reset</button>
</div>
<div class="panzoom" style="height: 480px;">
<%= render :file => @path %>
</div>

$(".panzoom").panzoom({
$zoomIn: $(".zoom-in"),
$zoomOut: $(".zoom-out"),
$zoomRange: $(".zoom-range"),
$reset: $(".reset")
});

最佳答案

使用the disablePan option :

$section.find('.panzoom').panzoom({
disablePan: true,
$zoomIn: $section.find(".zoom-in"),
$zoomOut: $section.find(".zoom-out"),
$zoomRange: $section.find(".zoom-range"),
$reset: $section.find(".reset")
});

关于javascript - Panzoom - 如何禁用拖动选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32753395/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com