Jquery UI同时使用可调整大小和可拖动 [英] Jquery UI use resizable and draggable at the same time
本文介绍了Jquery UI同时使用可调整大小和可拖动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
只是想调整大小并拖动图片,但 resizable
无效。
问题在哪里?我无法解决。
Just wanted to resize and drag an image but resizable
is not working.
Where is the issue ? I could not solve it.
$(function() {
$('#wrapper').draggable();
$('#image').resizable();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<div id="wrapper" style="display:inline-block">
<img id="image" src="http://www.google.com.br/images/srpr/logo3w.png" />
</div>
推荐答案
draggable
和 resizable
是jquery-ui的一部分,所以你必须包含它:
draggable
and resizable
are part of jquery-ui so you have to include it:
$(function() {
$('#wrapper').draggable();
$('#image').resizable();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<div id="wrapper" style="display:inline-block">
<img id="image" src="http://www.google.com.br/images/srpr/logo3w.png" />
</div>
这篇关于Jquery UI同时使用可调整大小和可拖动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文