js 获取当前位置
js获取当前对象坐在的坐标,使用offset属性:
var temp = $(this).offset(); var ittop = Math.round(temp.top+5); var itleft = Math.round(temp.left+120); opobj.attr("opid",id); opobj.attr("tabid",tabid); // opobj.offset({top:temp.top+5,left:temp.left+ow+75}); opobj.css({"top":ittop+"px","left":itleft+"px"});