$(function () { var w = $(window).width(); var h = $(window).height(); // banner 和 主体的滑动效果 if (navigator.userAgent.indexOf("MSIE 10.0") > 0 || w > 1024) { var t = true; function index_up() { // $(".head").stop(true, false).animate({ // "top": "-120px" // }, 300); $(".index").stop(true, false).animate({ "top": 0 }, 800, function () { // $(".head").addClass("on"); // $(".head").stop(true, false).animate({ // "top": "0" // }, 300); $(".index").css("position", "static"); $(".banner").css({ "position": "fixed", "z-index": "-1" }) }); t = false; $(".head_rgb").addClass("hide"); $(".head_wit").addClass("show"); 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": "-120px" // }, 300, function () { // $(".head").removeClass("on"); // }); $(".index").stop(true, false).animate({ "top": $('.banner').height() }, 800, function () { // $(".head").stop(true, false).animate({ // "top": "0" // }, 300); }); t = true; $(".head_rgb").removeClass("hide"); $(".head_wit").removeClass("show"); 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'); }; $('.banner>.slick').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, dots: false, autoplay: true, }); $('.banner-link>ul').slick({ slidesToShow: 7, slidesToScroll: 1, arrows: false, dots: false, autoplay: true, infinite: false, responsive: [ { breakpoint: 1201, settings: { slidesToShow: 5, } }, { breakpoint: 1201, settings: { slidesToShow: 4, } }, { breakpoint: 769, settings: { slidesToShow: 3, } }, { breakpoint: 481, settings: { slidesToShow: 1, centerPadding: '10%', infinite: true, centerMode: true, } } ] }); $('.s1-lc>ul').slick({ autoplay: true, dots: true, arrows: false, accessibility: true }); $('.s2-c>ul').slick({ slidesToShow: 4, slidesToScroll: 1, arrows: false, dots: false, autoplay: true, responsive: [ { breakpoint: 1025, settings: { slidesToShow: 3, } }, { breakpoint: 769, settings: { slidesToShow: 2, } }, { breakpoint: 481, settings: { slidesToShow: 1, } } ] }); $('.s3-r>ul').slick({ autoplay: true, dots: false, arrows: true, accessibility: true, prevArrow: '.s3-rprev', nextArrow: '.s3-rnext' }); $('.s4-c>ul').slick({ slidesToShow: 5, slidesToScroll: 1, arrows: true, dots: false, autoplay: true, responsive: [ { breakpoint: 1201, settings: { slidesToShow: 4, } }, { breakpoint: 1024, settings: { slidesToShow: 3, } }, { breakpoint: 769, settings: { slidesToShow: 2, } }, { breakpoint: 481, settings: { centerMode: true, slidesToShow: 1, centerPadding: '10%' } } ] }); $('.s4-b>ul').slick({ slidesToShow: 6, slidesToScroll: 1, arrows: true, dots: false, autoplay: true, responsive: [ { breakpoint: 1201, settings: { slidesToShow: 4, } }, { breakpoint: 1024, settings: { slidesToShow: 3, } }, { breakpoint: 769, settings: { slidesToShow: 2, } },{ breakpoint: 481, settings: { centerMode: true, slidesToShow: 1, centerPadding: '10%' } } ] }); });