标签: jquery
找到div区域角落的四个值
答案 0 :(得分:2)
相对于文件:
var offset = $('#div').offset(); var x1 = offset.left; var y1 = offset.top; var x2 = x1 + $('#div').width(); var y2 = y2 + $('#div').height();