<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="Ban YanNing" />
<title>jquery网站滚动条整屏滑动切换 - 网页模板</title>
<style>
body{margin:0;padding:0}
#s1{height:800px;background:#66C280}
#s2{height:800px;background:#3B86D8}
#s3{height:800px;background:#9931B9}
#s4{height:800px;background:#B63726}
#s5{height:800px;background:#F0E67B}
</style>
<script type="text/javascript" src="jquery.min.js"></script>
</head>
<body>
<div style="height:2000px;">
<div id="s1" class="pager"></div>
<div id="s2" class="pager"></div>
<div id="s3" class="pager"></div>
<div id="s4" class="pager"></div>
<div id="s5" class="pager"></div>
</div>
<script type="text/javascript" src="jquery.mousewheel.js"></script>
<script type="text/javascript" src="nicescroll.js"></script>
<script>
jQuery(function($) {
var iPagerCount=$(".pager").length;
var iPageNumber=0;
var aTop=[0,800,1600,2400,3200,4000,4600];
var sTop=$(window).scrollTop();
if(sTop>=aTop[0]&&sTop<aTop[1]){iPageNumber=0;}
if(sTop>=aTop[1]&&sTop<aTop[2]){iPageNumber=1;}
if(sTop>=aTop[2]&&sTop<aTop[3]){iPageNumber=2;}
if(sTop>=aTop[3]&&sTop<aTop[4]){iPageNumber=3;}
if(sTop>=aTop[4]&&sTop<aTop[5]){iPageNumber=4;}
if(sTop>=aTop[5]&&sTop<aTop[6]){iPageNumber=5;}
if(sTop>=aTop[6]){iPageNumber=6;}
//美化浏览器的滚动条
$("html").niceScroll({
touchbehavior:false,cursorcolor:"#0966ce",cursoropacitymax:1,cursorwidth:8,horizrailenabled:true,cursorborderradius:5,autohidemode:true,background:'none',cursorborder:'solid 1px #0966ce'
});
//滑动滚动条翻屏效果
$("html,body").bind("mousewheel",function(event,intDelta){
var $this=$(this),
timeoutId=$(this).data('timeoutId');
if(timeoutId){
clearTimeout(timeoutId);
}
$this.data('timeoutId',setTimeout(function(){
intDelta>0?pageUp():pageDown();$this.removeData('timeoutId');$this=null;
},150));
return false;
});
function pageUp(){
iPageNumber=iPageNumber<=0?0:iPageNumber-1;slide(aTop[iPageNumber]);
}
function pageDown(){
iPageNumber=iPageNumber>=iPagerCount-1?iPageNumber:iPageNumber+1;slide(aTop[iPageNumber]);
}
function slide(length){
$("body,html").stop().animate({scrollTop:length},800,'easeOutExpo');
}
//扩展动画
$.extend($.easing,{
easeOutExpo:function(e,f,a,h,g){
return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a
},easeOutBounce:function(x,t,b,c,d){
if((t/=d)<(1/2.75)){
return c*(7.5625*t*t)+b;
}else if(t<(2/2.75)){
return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;
}else if(t<(2.5/2.75)){
return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;
}else{
return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;
}
}
});
});
</script>
<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
<p>适用浏览器:IE8、360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗. </p>
<p>来源:<a href="http://www.moobnn.com/" target="_blank">网页模板</a></p>
</div>
</body>
</html>