问题
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