var ele = document.querySelector('.TxtConBox');
var rect = ele.getBoundingClientRect();
var left = rect.left + ele.scrollLeft;
var top1 = document.body.clientHeight ;
var width = rect.width;
var height = rect.height;
console.log('ele left:' + left+',top:' + top1+',width:'+width+',height:' + height);
getBoundingClientRect()返回一个对象,包含以下几个属性还有一些方法bottom:731
height:47
left:0
right:414
top:684
width:414
scrollTop:第一个代表页面利用滚动条滚动到下方时,隐藏在滚动条上方的页面的高度;
scrollLeft:第二个代表页面利用滚动条滚动到右侧时,隐藏在滚动条左侧的页面的宽度
29
var ele = document.querySelector('.TxtConBox');
var rect = ele.getBoundingClientRect();
var left = rect.left + ele.scrollLeft;
var&nbs