$(function () { var w = $(window).width(); // banner 和 主体的滑动效果 if (navigator.userAgent.indexOf("MSIE 10.0") > 0 || w > 1024) { var t = true; function index_up() { $(".head").stop(true, false).animate({ "top": "-150px" }, 500); $(".index").stop(true, false).animate({ "top": 0 }, 800, function () { $(".head").addClass("head_wit"); $(".head").stop(true, false).animate({ "top": "0" }, 500); $(".index").css("position", "static"); $(".banner").css({ "position": "fixed", "z-index": "-1" }) $("html, body").stop().animate({ scrollTop: "1" }, 1, function () { $("html, body").stop().animate({ scrollTop: 0 }, 1) }) }); t = false; $(".fixed-r").addClass("on") return false; } function index_down() { if ($(window).scrollTop() <= 0) { $(".index").css("position", "fixed"); $(".banner").css({ "position": "static", "z-index": "1" }) $(".head").stop(true, false).animate({ "top": "-150px" }, 500, function () { $(".head").removeClass("head_wit"); }); $(".index").stop(true, false).animate({ "top": $('.banner').height() }, 800, function () { $(".head").stop(true, false).animate({ "top": "0" }, 500); }); t = true; $(".fixed-r").removeClass("on") return false; }; } $(document).keydown(function (event) { if (event.keyCode == 40) { if (t) { index_up(); } } else if (event.keyCode == 38) { if (!t) { index_down() } } }) $('.banner').on('mousewheel', function (e) { var delta = e.originalEvent.wheelDelta || e.originalEvent.detail; if (delta < 0) { index_up() } }) $('.index').on('mousewheel', function (e) { var delta = e.originalEvent.wheelDelta || e.originalEvent.detail; if (delta > 0) { index_down() } }); // 火狐滚动事件兼容 document.querySelector('.banner').addEventListener('DOMMouseScroll', function (e) { var delta = e.detail; if (delta > 0) { index_up(); } }); document.querySelector('.index').addEventListener('DOMMouseScroll', function (e) { var delta = e.detail; if (delta < 0) { index_down() } }); } else { $("body").addClass('m'); }; $("#downPage").click(function () { index_up(); }) $('.banner .slick').slick({ slidesToShow: 1, slidesToScroll: 1, autoplay: true, dots: true, arrows: true, }); $(".s1-bottom ul li").mouseenter(function () { $(this).addClass("on").siblings().removeClass("on"); }); $('.s2-l>ul').slick({ autoplay: false, slidesToShow: 1, slidesToScroll: 1, dots: true, arrows: false, }); $('.c2-l>ul').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: true, dots: true, autoplay: true }); $('.banner2>ul').slick({ slidesToShow: 4, slidesToScroll: 1, arrows: true, dots: false, autoplay: true, prevArrow: '.s4-tlprev', nextArrow: '.s4-tlnext', responsive: [{ breakpoint: 1025, settings: { slidesToShow: 3, slidesToScroll: 1, } }, { breakpoint: 769, settings: { slidesToShow: 1, slidesToScroll: 1, centerMode: true, centerPadding: '10%' } } ] }); $('.s3-tl>ul').slick({ autoplay: false, slidesToShow: 1, slidesToScroll: 1, dots: false, arrows: false, }); $('.s3-tr>ul').slick({ autoplay: false, slidesToShow: 1, slidesToScroll: 1, dots: false, arrows: false, }); $('.s3-b>ul').slick({ autoplay: false, slidesToShow: 4, slidesToScroll: 1, dots: false, arrows: true, responsive: [{ breakpoint: 1025, settings: { slidesToShow: 3, slidesToScroll: 1 } }, { breakpoint: 769, settings: { slidesToShow: 2, slidesToScroll: 1 } }, { breakpoint: 481, settings: { slidesToShow: 1, slidesToScroll: 1 } }] }); });