美文网首页
js获取窗口高度 元素高度 滚动高度

js获取窗口高度 元素高度 滚动高度

作者: IT行者q | 来源:发表于2019-04-16 21:23 被阅读0次
    //兼容chrome和火狐浏览器
    var oTop = document.body.scrollTop==0?document.documentElement.scrollTop:document.body.scrollTop;//获取滚动高度
    var clientHeight = $(window).height();//获取窗口高度
    var documemtHeight = $('#scroll').height();//获取元素高度
    

    相关文章

      网友评论

          本文标题:js获取窗口高度 元素高度 滚动高度

          本文链接:https://www.haomeiwen.com/subject/kyniwqtx.html