-1

我已将 jquery ui 包含在我的页面中,并尝试将可调整大小应用到 img 但它不起作用。

<script src="jquery-ui-1.10.3.custom.js" type="text/javascript"></script>

$('.jqte_editor').on('mouseup', 'img', function() {
  $('.jqte_editor img').draggable().resizable();
});

但它说无法识别可调整大小。

实际上在这种情况下编辑 它说 Draggable 无法识别来自 jqueryui 的任何内容

4

2 回答 2

1

这意味着jquery-ui-1.10.3.custom.js路径不正确或所需模块不包括draggable在内resizable

添加这个并尝试

<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>

如果不起作用,那么您可能已经在 jQuery 中包含了其他 JS 库,例如 Prototype 或 Mootools

演示链接

于 2013-07-12T10:42:50.917 回答
0

希望你也添加了 jQuery 库,因为它没有显示任何错误.on()

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" type="text/javascript"></script>

也可以代替mouseup你直接拥有

$(document).ready(function () {    
    $('.jqte_editor img').draggable().resizable(); 
});

在此处检查工作示例小提琴

于 2013-07-12T10:40:33.720 回答