简体   繁体   中英

jQuery-ui draggable error message

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'
    });
});

Demo: http://jsfiddle.net/33V9T/

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM