PDA

View Full Version : Scriptaculous Dragging



GeorgeMorgan
10-05-2008, 11:50 AM
Hey,

When using scriptaculous to drag a div, how can I make it show me or alert me the x and y co-ordinates when finished?

Thanks for help

Florx
11-05-2008, 11:24 AM
new Draggable('DIVNAME',{onEnd:function(){
var x = document.getElementById('DIVNAME').style.left;
var y = document.getElementById('DIVNAME').style.top;
alert('X='+x+' Y='+y);
},

revert:false
});

Try that.

Want to hide these adverts? Register an account for free!