JQUERY-UI Draggable with asynchronous selectors

2019-08-28 02:32发布

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条回答
欢心
2楼-- · 2019-08-28 03:17

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

$("#containerselector").load('path', function () {
    $(this).find( "elementsthatshouldbedraggableselector" ).draggable();
});
查看更多
登录 后发表回答