var pos = $('#small').offset();
console.log(pos.left);
console.log(pos.top);
var l = $('#small').position().left;
var t = $('#small').position().top;
console.log(l,t);
var st = $(document).scrollTop();
var sl = $(document).scrollLeft();
var w = $('#big').width();
var h = $('#big').height();
$('#big').width(400);
$('#big').height(400);
// console.log(w,h);
var w = $(window).width();
var h = $(window).height();
var w = $(document).width();
var h = $(document).height();
console.log(w,h);
原文:https://www.cnblogs.com/aduner/p/12238428.html