Im使用jquery pep拖放。
我可以把它拖動,但我不知道如何來獲取對象的當前位置..
這裏是我的代碼:
var options = {
cssEaseDuration: 1000
start: function(ev,obj){ $('#title').text('Start!'); },
drag: function(ev,obj){
console.log("we're dragging!");
// **I have to know here the coordinates**
},
rest: function(ev,obj){
console.log("stopped!");
}
};
rectangle.pep(options);
這裏是演示頁: http://pep.briangonzalez.org/demo
(你可以在這個頁面看到,在調試模式下,你可以看到座標 - 右下角 - 但我不能使用它)
全部信息: http://www.wwvalue.com/web-design/jquery/kinetic-drag-with-jquery-css3-and-html5.html
非常感謝您的幫助!
謝謝!代碼是工作,但我需要的對象的當前位置,而不是隻有鼠標位置... – EranLevi