链接到jsFiddle
HTML
<div class="empty ui-widget-content">
<div class="settings-menu">
</div>
</div>
CSS
.empty {
height: 50px;
display: block;
float: left;
position: relative;
margin: 6px 0;
width: 100%;
background: grey;
}
JS
$('.empty').resizable();
为什么,哦,为什么会发生这么基本的事情?
最佳答案
问题是 jQuery 和 jQuery UI 的版本。
从 jQuery 版本 1.9 开始,browser() 方法已被删除。您可以使用不同/旧版本的库来解决问题。
The jQuery.browser() method has been deprecated since jQuery 1.3 and is removed in 1.9. If needed, it is available as part of the jQuery Migrate plugin. We recommend using feature detection with a library such as Modernizr.
或者,如果您不想使用旧版本的插件,请使用 jQuery Migrate plugin .
关于jquery ui ressized() 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25076767/