在rails 4.2.2项目中,我使用panzoom
jquery作为html元素(而不是图像),对于我使用annotator
插件的同一页面。现在问题是注释器无法正常工作,因为我无法在页面中选择任何单词。由于panzoom
,整个html正在移动(拖动),如何在其中禁用“拖动”选项?
由http://www.jqueryscript.net/zoom/jQuery-Plugin-For-Panning-Zooming-Any-Elements-panzoom.html
引用在观看中,
<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")
});
答案 0 :(得分:1)
$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")
});