View Full Version : how can I catch enddrag event on a panel

8 Jan 2007, 2:07 AM

I want to do some operation when my pannel is dragged to a new location.

my code is as follows.

var myPanel = new YAHOO.widget.Panel("panel"+i, {xy:[100,100], width:"300px", visible:true, draggable:true, close:true, constraintoviewport:true } );


in my event handler i am doing an alert message for the time being.

Problem with this is whenever I drag my object this handler is called 3 times. ( I guess 1 when drag starts, then on dragging state and 1 time when I finish drag).

What I want is I want this event handler to be called only when I finish dragging the object.

I have tried to use endDrag as well but it does not work.