zoukankan      html  css  js  c++  java
  • 全屏滑动效果

    // 引用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>
  • 相关阅读:
    Cassandra 分页 读取数据
    cassandra高级操作之索引、排序以及分页
    cassandra 可视化工具
    SpringBoot集成Cassandra参考文章
    022 android studio 首次启动时默认的sdk安装路径
    021 Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout)
    020 本机Gradle目录 Could not find com.android.tools.build:gradle:4.1
    019 Android Studio打开XML文件Design显示Waiting for build to finish
    018 Could not download espresso-core-3.2.0.aar (androidx.test.espresso:espresso-core:3.2.0)
    017 Android Studio is using the following JDK location when running Gradle:
  • 原文地址:https://www.cnblogs.com/wylj/p/8660533.html
Copyright © 2011-2022 走看看