JQUERY-UI Draggable with asynchronous selectors

萝らか妹 提交于 2019-12-11 16:25:13

问题


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...


回答1:


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

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


来源:https://stackoverflow.com/questions/15629185/jquery-ui-draggable-with-asynchronous-selectors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!