// 引用mousewheel.js
<script type="text/javascript">
$(function(){
var count = 1,Mouse = true;
var height = $(window).height();
var footH = $(".footer").height();
$('body').on('mousewheel', function(event){
// console.log(event.deltaY)
if(event.deltaY > 0){ //向上
console.log(count)
// console.log("向上" + count)
if(count == 7){
Mouse = true;
}
if(!Mouse){
return
}
Mouse = false;
if(count == 7){
count -- ;
// $(".swipe"+(count)).stop().addClass("on").siblings().removeClass("on");
$(".swipe").each(function(ind){
if(ind == 5 ){
$(this).stop().animate({top: (height - 91) * (ind - count + 1)},1000,function(){
Mouse = true;
});
}else{
$(this).stop().animate({top: (ind - count + 1) * (height - 91)},1000,function(){
Mouse = true;
});
}
console.log(12)
$(".footer").stop().animate({top: "1000px"},1000);
$(".fot label:eq("+ (count - 1 ) +")").addClass("on").siblings().removeClass("on");
});
}else if(count > 1){
count -- ;
$(".swipe").each(function(ind){
$(this).stop().animate({top: (height - 91) * (ind - count +1)},1000,function(){
Mouse = true;
});
});
$(".fot label:eq("+ (count - 1 ) +")").addClass("on").siblings().removeClass("on");
}
}else{ //向下
if(count == 1){
Mouse = true;
}
if(!Mouse){
return
}
Mouse = false;
if(count < 6){
$(".swipe").each(function(ind){
if(ind == (count ) ){
$(this).stop().animate({top: (ind - count) * (height - 91)},1000,function(){
Mouse = true;
});
}else{
$(this).stop().animate({top: (ind - count) * (height - 91)},1000,function(){
Mouse = true;
});
}
});
$(".fot label:eq("+count+")").addClass("on").siblings().removeClass("on");
count ++;
}else if(count == 6){
$(".swipe").each(function(){
var ind = $(this).index();
if(ind == 6){
$(this).stop().animate({top: -footH },1000);
}else{
$(this).stop().animate({top: (height - 91) * (ind - count) },1000);
}
console.log(ind)
});
$(".footer").stop().animate({top:(height - footH - 121)},500,function(){
// Mouse = false;
});
$(".fot label:eq("+count+")").addClass("on").siblings().removeClass("on");
count++;
}
}
});
$(".fot label").click(function(){
if( !$(this).hasClass("on") ){
var inde = $(this).index() + 1;
$(this).addClass("on").siblings().removeClass("on")
if(inde < 7){
$(".swipe").each(function(ind){
if(ind == (inde ) ){
$(this).stop().animate({top: (ind - inde + 1) * (height - 91)},1000,function(){
Mouse = true;
});
}else{
$(this).stop().animate({top: (ind - inde +1 ) * (height - 91)},1000,function(){
Mouse = true;
});
}
});
$(".footer").stop().animate({top:(height)},500);
count = inde;
}else if(inde == 7){
$(".swipe").each(function(){
var ind = $(this).index();
if(ind == 6){
$(this).stop().animate({top: - footH },1000);
console.log(footH)
}else{
$(this).stop().animate({top: (height - 91) * (ind - inde + 1) },1000);
}
});
$(".footer").stop().animate({top:(height - footH - 121)},500);
count = inde;
}
console.log( count +";"+inde )
}
});
})
</script>