webapi

获取元素到页面顶部距离的语句为:

1、jquery写法:
$(“#divID”).offset().top  //推荐

$("#vertical").position().top

2、js写法:

document.getElementById("divID").offsetTop  //推荐

分类:

技术点:

相关文章: