Search and Top Navigation
#2719 closed enhancement (notabug)
Opened April 19, 2008 08:22AM UTC
Closed May 03, 2008 06:32AM UTC
Last modified May 24, 2008 03:39AM UTC
ui.droppable very slow
Reported by: | aiiiq | Owned by: | paul |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | ui.core | Version: | 1.2.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
There're 100 DIV need drag&drop.
Make them draggable only, it's veryfast.
I think the problem is in droppable.
How to make it faster?
Thanks!
<html>
<script src="jquery-1.2.4a.js"></script>
<script src="ui.base.js"></script>
<script src="ui.draggable.js"></script>
<script src="ui.droppable.js"></script>
<style>
.mydrag {width:100px; height:100px; margin:10px; float:left; cursor:pointer; background-color:#68BFEF;}
</style>
<script>
$(document).ready(function(){
for (var div,i=1; i<=100; i++) {
div += '<div id="'+i+'" class="mydrag">'+i+'</div>';
}
$(div).appendTo("body");
$('.mydrag').draggable({
helper: 'clone'
});
$('.mydrag').droppable({
accept: '.mydrag',
drop: function(ev, ui) {
$(this).append($(document.createElement('div')).text($(ui.draggable).attr('id')+'->'+$(this).attr('id')));
}
});
});
</script>
</html>
There is no way to make it faster, in general - however, we made a lot if improvements recently, so I suggest to grab the latest copy from the trunk.