具有异步选择器的JQUERY-UI可拖动 [英] JQUERY-UI Draggable with asynchronous selectors

查看:109
本文介绍了具有异步选择器的JQUERY-UI可拖动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将JQUERY-UI可拖动与使用jquery的.load函数异步导入的元素一起使用?我想我需要使用.on或.bind,但无法找出有效的方法...

Is it possible to use JQUERY-UI draggable with elements that are imported asynchronously using jquery's .load function? I guess that I would need to use .on or .bind, but can't figure out something that works...

推荐答案

我只会使用.load回调函数来分配可拖动属性:

I would just use the .load callback to assign the draggable property:

$("#containerselector").load('path', function () {
    $(this).find( "elementsthatshouldbedraggableselector" ).draggable();
});

这篇关于具有异步选择器的JQUERY-UI可拖动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆