Ryan Gahl escribió:

I think the first argument isn’t the draggable itself, but the element that is draggable. So the below would only work if you also stored a reference to the draggable in the element, like this…

$(‘someElement’).draggable = new Draggable($(‘someElement’), {…options…} );

onDrop = function(draggableElement, droppable) {

draggableElement.draggable.options.revert = false;

}

That should do the trick.

------------------------------------------------------------------------

*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *::Alex Rengel::
*Sent:* Monday, February 27, 2006 10:01 AM
*To:* rails-spinoffs@lists.rubyonrails.org
*Subject:* RE: Re: [Rails-spinoffs] Question abour Draggables & Droppables

It's not working:

draggable.options.revert is not working...

Any other suggestions?

    ------------------------------------------------------------------------

    Date: Sun, 26 Feb 2006 19:39:24 -0500
    From: [EMAIL PROTECTED]
    To: rails-spinoffs@lists.rubyonrails.org
    Subject: Re: [Rails-spinoffs] Question abour Draggables & Droppables

    >From the wiki:

    OnDrop: Called whenever a Draggable is released over the Droppable
    and the Droppable is accepts it. The callback gets two parameters:
    the Draggable element, and the Droppable element

    Never actually tried this, but:

    onDrop: function(draggable,droppable){ draggable.options.revert =
    false; }

    should work, right? Not sure when the revert() function gets
    invoked though...

    -Jerod

    On 2/26/06, *::Alex Rengel::* <[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>> wrote:

    Hi,

    What I need to know is how to change revert:true to revert:false
    from a draggable after I drop it on a droppable so it doesn't
    return to its original place.

    Something like:

    [CODE]

    <!-- Draggable image -->

    <img alt="Product" id="item" src="icon.png">

    <script type="text/javascript"> new
    Draggable(item,{revert:true});</script>

    <!-- Droppable Div -->

    <div id="droparea" style="height:100px;width:100px;">
    <script type="text/javascript">
    //Droppable Cart
    Droppables.add('droparea', {onDrop:function(element, dropon,
    event){ /* REVERT FALSE */ }});
    </script>
    [/CODE]

    Thank you in advance!

    ------------------------------------------------------------------------

    Express yourself instantly with MSN Messenger! MSN Messenger
    <http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/>
    _______________________________________________
    Rails-spinoffs mailing list
    Rails-spinoffs@lists.rubyonrails.org
    <mailto:Rails-spinoffs@lists.rubyonrails.org>
    http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

------------------------------------------------------------------------

Express yourself instantly with MSN Messenger! MSN Messenger <http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/>

The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.

------------------------------------------------------------------------

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Hi!

I read these threat but draggableElement.draggable.options.revert = false; doesn't work

the error is: draggableElement.draggable has no properties

Any Idea?

Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito/


_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to