$(document).height()与$(window).height()
来源:互联网 发布:人工蜂群算法优缺点 编辑:程序博客网 时间:2024/05/17 01:29
http://www.cnblogs.com/piuba/archive/2013/01/06/2847295.html
jQuery(window).height()代表了当前可见区域的大小,而jQuery(document).height()则代表了整个文档的高度,可视具体情况使用.
注意当浏览器窗口大小改变时(如最大化或拉大窗口后) jQuery(window).height() 随之改变,但是jQuery(document).height()是不变的。
$(document).scrollTop() 获取垂直滚动的距离 即当前滚动的地方的窗口顶端到整个页面顶端的距离$(document).scrollLeft() 这是获取水平滚动条的距离要获取顶端 只需要获取到scrollTop()==0的时候 就是顶端了要获取底端 只要获取scrollTop()>=$(document).height()-$(window).height() 就可以知道已经滚动到底端了$(document).height() //是获取整个页面的高度$(window).height() //是获取当前 也就是你浏览器所能看到的页面的那部分的高度 这个大小在你缩放浏览器窗口大小时 会改变 与document是不一样的 根据英文应该也能理解吧自己做个实验就知道了 $(document).scroll(function(){ $("#lb").text($(document).scrollTop());})<body style=" height:5000px;"> <span id="lb" style="top:100px;left:100px;position:fixed;"></span><!--一个固定的span标记 滚动时方便查看-->
0 0
- (document).height()与$(window).height()
- (document).height()与$(window).height()
- (document).height()与$(window).height()
- (document).height()与$(window).height()
- (document).height()与$(window).height()
- $(document).height()与$(window).height()
- (document).height()与$(window).height()
- (document).height()与$(window).height()
- (document).height()与$(window).height()
- (document).height()与$(window).height()
- $(window).height()与$(document).height()
- $(document).height()与$(window).height()
- (document).height()与$(window).height()
- (document).height()与$(window).height()
- $(document).height()与$(window).height()的区别
- $(document).height()与$(window).height()区别
- $(window).height()和$(document).height()
- (document).height()与$(window).height()和顶部底部数据获取
- 构建基于Jenkins + Github的持续集成环境
- [leetcode]215. Kth Largest Element in an Array
- jquery ajax在跨域访问post请求的时候,ie9以下无效(包括ie9)
- 一对一 一对多 多对多
- 初步认识:jqGrid
- $(document).height()与$(window).height()
- leetcode题解-3. Longest Substring Without Repeating Characters
- Android 混合开发 的一些心得。
- 虚拟网桥和网卡的轮训工作
- CCF网络延时---求树中两个最远结点的距离
- oracle 12c 智能闪存缓存(smart flash cache)
- React Native中模拟器command+R刷新不了的问题
- 设计模式之--单例模式
- Trie树结构与实现