I'm trying to make a page with divs that you can move..
And now to my problem: Everytime i move a div i get this error
TypeError: $(...).data(...) is undefined
var o = $(this).data("ui-draggable").options;
Here's a picture of my boxes:
As you can see the green boxes floats to the left, the first time i'm going to move it..
Why is that? Can i change that so it doesn't move that much?
Here is my code right now: http://jsfiddle.net/9G9dR/
Why are you setting both sortable and draggable?
You can use only sortable
with connectWith
.
Code:
$(document).ready(function () {
$('.Sortable').sortable({
connectWith: '.Sortable'
});
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.