当有人在我的虚拟游戏中点击我的字段时,我会得到我当前的左侧和顶部坐标:
function moveDiv(fromSeat, toSeat){
var fromTop = $('#seat-' + fromSeat).css("top");
var fromLeft = $('#seat-' + fromSeat).css("left");
var toTop = $('#seat-' + toSeat).css("top");
var toLeft = $('#seat-' + toSeat).css("left");
/** Move a div from point {"fromTop", "fromLeft"} => {"toTop", "topLeft"} **/
}
我被困在这里,我试图制作一个 $('...').animate({}); 但无法让它工作。我希望 div "#test" 从点 {"fromTop", "fromLeft"} => {"toTop", "topLeft"} 移动