views:

276

answers:

1

Hello,

I've been using mootools for some time and trying jQuery for a week so this probably is a newbie question - though I've found nothing in the manuals.

In mootools, when you use the option clone in a sortables list it creates a clone of your image/object that helps you visualize where the image/object will be droppped - works great on my thumbnail sorting system.

mootools sortables doc page

Well, jQuery also has that same option, clone but when I use it doesn't do a thing. Meaning, it in fact clones the element and the one you drag around is a clone but when you drop-it the original stays exactly where it previously was. You can check this behavior with the draggable demo they have on their site. Take a look at the semi-transparent-clone, you can move it around and when you drop it is stays right there.

Is this buggy behavior or just how its supposed to be? I could replicate mootools behavior on my own but though this would be a standard option...

Thank you in advance!

+1  A: 

Maybe I hit the panic button way to soon.

There are obvious different philosophies of though in the frameworks and, I must agree, the cloning as it works in jQuery is more sensible.

They could, however, have an option, maybe call it shadow, to double what mootools does. Nevertheless, if you are in a hurry, had my doubt and wanna mimic mootool's behavior just do something like this:

$('#galery-thumb-list').sortable({
    helper: 'clone',
    tolerance: 'pointer',

    start: function(e, ui) {
        ui.placeholder.html(ui.item.html());
        ui.placeholder.css({
            'visibility': 'visible',
            'opacity': 0.1
        });
    }
});

Pretty simple but confusing for a first timer as "clone" and "clone" are obviously different things in different frameworks.

Hope it helps someone!

Frankie