码迷,mamicode.com
首页 > Web开发 > 详细

js 获取距离顶部的相对高度

时间:2018-03-30 21:40:31      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:相对   null   color   log   blog   var   gpo   ret   +=   

getTop (e) { 
        var offset=e.offsetTop; 
        if(e.offsetParent!=null) offset+=this.getTop(e.offsetParent); 
        return offset; 
 },

 

js 获取距离顶部的相对高度

标签:相对   null   color   log   blog   var   gpo   ret   +=   

原文地址:https://www.cnblogs.com/CyLee/p/8678240.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!