Wojtek's solution worked perfectly for me. I wound up changing it a tad bit to make it extend jQuery...
(function ($) {
$.fn.liveDraggable = function (opts) {
this.live("mouseover", function() {
if (!$(this).data("init")) {
$(this).data("init", true).draggable(opts);
}
});
return this;
};
}(jQuery));
Now instead of calling it like:
$(selector).draggable({opts});
...just use:
$(selector).liveDraggable({opts})
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…