Thanks,

I am getting better at this! Is there a simple way to get the position within the element that was clicked?

Deco
On Jan 11, 2006, at 12:25 AM, Brian Peiris wrote:

This page will give you the position of the mouse when the element is dropped.

<html>
    <head>
        <title>script.aculo.us Drag and drop functional test file</title>
        <script src="" type="text/_javascript_"></script>
        <script src="" type="text/_javascript_"></script>
        <script src="" type="text/_javascript_"></script>
    </head>
    <style>
        div.hoverclass123 {
            border:1px solid red;
        }
    </style>
    <body>
        
        <h1>script.aculo.us Drag and drop functional test file</h1>
        
        <h2>w/o hoverclass</h2>
        
        <div id="cart" class="cart" style="text-align:center;height:50px;padding:10px;background-color:#fba">
            <span>### DROP HERE ###</span>
         </div>
        
        <script type="text/_javascript_">Droppables.add('cart', {onDrop:function(element,dropon,event){alert('w/o hoverclass, should be \'product_id\':' + encodeURIComponent( element.id) + ', dropon should be \'cart\':' + dropon.id);alert(Event.pointerX(event)+", "+Event.pointerY(event));}})</script>
        
         <br/>
        
        <img alt="Product2" id="product_id" src="" />
        <span>&lt;-- drag this!</span>
        
        <script type="text/_javascript_">new Draggable('product_id', {revert:true})</script>
        
    </body>
</html>

On 1/11/06, Deco Rior <[EMAIL PROTECTED]> wrote:
> Hi, everyone:
>
> I am starting with doing draggables, etc.
>
> I am looking at the droptest_5 example.
>
> How do I get back the final position of the dragged element in
> coordinates?
>
> Deco
> _______________________________________________
> Rails-spinoffs mailing list
>  [email protected]
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>



--
============================
Brian Peiris
Brampton, Ontario, Canada
[EMAIL PROTECTED] or [EMAIL PROTECTED]
============================  
_______________________________________________
Rails-spinoffs mailing list

_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to