The problem is, I think, that the draggable plugin if used without a 
helper modifies the dragged element to position: absolute.
At that point moving it in the DOM doesn't have any visible effect, it 
simply sits where I let go of it instead of 'snapping' into
the destination cell. I've got it working with a helper though.

Scott González wrote:
> The draggable plugin only moves the element on screen (changes it's
> top and left offset), it does not natively affect the DOM in any other
> way.  The proper way to handle this is to do what you did in the drop
> callback, which is to modify the DOM yourself, but you shouldn't need
> a cloned helper to accomplish this.
>
>
> On Jan 18, 9:55 am, Kevin Thorpe <[EMAIL PROTECTED]> wrote:
>   
>> Thanks for your comments. I've just cracked it (I think). I was getting
>> the drop event ok but couldn't work out how to move the dragged div. It
>> was just sitting where I'd dropped it.
>>
>> The secret is to use a cloned helper with $('.drag').draggable({helper:
>> 'clone'}); and then move the original draggable div using:
>>     $(".drop").droppable({
>>         accept: ".drag",
>>         tolerance: 'pointer',
>>         activeClass: 'droppable-active',
>>         hoverClass: 'droppable-hover',
>>         drop: function(ev, ui) {
>>           if (this.children.length == 0) {
>>             $(this).append(ui.draggable.element);
>>           }
>>         }
>>     });
>> I think my problem was that without a helper the draggable div is
>> converted to position: absolute so that it didn't matter which table
>> cell it was in.
>>
>> I just wish I knew more about the DOM.
>>     


-- 
Kevin Thorpe
Head of IT
Purchasing Index Ltd
Southbank House
Black Prince Road
London SE1 7SJ
tel: 020 7463 2022
fax: 020 7463 2025

Mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
URL: http://www.pricetrak.com
*/Registered in England No. 1728605/*
------------------------------------------------------------------------
All views or opinions expressed in this message are solely those of the 
author. Accordingly, Purchasing Index Ltd does not accept responsibility 
for the contents of the message unless specifically stated otherwise. If 
you have received this message in error, please notify the sender and 
delete the message immediately.

Reply via email to