<script type="text/javascript"> $(document).ready(function(){     alert($(window).height()); //浏览器时下窗口可视区域高度     alert($(document).height()); //浏览器时下窗口文档的高度     alert($(document.body).height());//浏览器时下窗口文档body的高度     alert($(document.body)…
//判断页面滚动到顶部和底部 $(window).scroll(function(){ var doc_height = $(document).height(); var scroll_top = $(document).scrollTop(); var window_height = $(window).height(); if(scroll_top == 0){ alert("到顶啦"); }else if(scroll_top + window_height >= doc…
jQuery判断滚动条是上滚还是下滚,且是否到达底部或顶部:http://www.haorooms.com/post/jquery_scroll_upanddown //滚动条滚动加载更多内容 //判断滚动方向 function scroll(fn) { var beforeScrollTop = document.body.scrollTop || document.documentElement.scrollTop, fn = fn || function() {}; window.addE…
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server">    <titl…
一.jQuery检测浏览器window滚动条到达底部 jQuery获取位置和尺寸相关函数:$(document).height()    获取整个页面的高度:$(window).height()    获取当前也就是浏览器所能看到的页面的那部分的高度.这个大小在你缩放浏览器窗口大小时会改变,与document是不一样的:scrollTop()    获取匹配元素相对滚动条顶部的偏移:scrollLeft()    获取匹配元素相对滚动条左侧的偏移:scroll([[data],fn])    当…
clientHeight:这个元素的高度,占用整个空间的高度,所以,如果一个div有滚动条,那个这个高度则是不包括滚动条没显示出来的下面部分的内容.而只是单纯的DIV的高度. offsetHeight:是指元素内容的高度.依照上面的,那这个高度呢就是DIV内部的高度,包括可见部分及以滚动条下面的不可见部分. scrollTop:滚动条已经滚动的当前值. 举例,如果一个DIV高度是400px(即clientHeight为400),而里面的内容是一个很长的列表,内容的高度是1000px(即offse…
判读滚动某个div显示底部按钮 <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, us…
原文地址 http://www.111cn.net/wy/jquery/61741.htm…
BottomJumpPage: function () { var scrollTop = $(this).scrollTop(); var scrollHeight = $(document).height(); var windowHeight = $(this).height(); if (scrollTop + windowHeight == scrollHeight) { //滚动到底部执行事件 console.dir("我到底部了"): } if (scrollTop ==…
先引入js:<script type="text/javascript" src="jquery.js" ></script><script type="text/javascript" src="towhere.js" ></script> 假设页面: <body> <a href="javascript:;" id="to-bo…