$(function () { // 浜嬩欢闆嗗悎 function toggleNav(_parent, _clickDom, _subnav, _navLI, _subnavA) { $(_parent).off('click').on('click', _clickDom, function () { if ($(this).parent('h3').siblings(_subnav).is(':hidden')) { $(this).parent('h3').siblings(_subnav).stop(true, true).slideDown(300); $(this).parents('li').addClass('active').siblings().removeClass('active').find(_subnav).stop(true, true).slideUp(300); } else { $(this).parents('li').removeClass('active').find('h3').siblings(_subnav).stop(true, true).slideUp(300); } }); $(_navLI).each(function () { if (!$(this).find(_subnavA).length) { $(this).find('h3 i').hide(); } }); }; // 鍥炲埌椤堕儴 // 杩斿洖椤堕儴 $(window).scroll(function () { var _scrTop = $(window).scrollTop(); // less winScroll(); if (_scrTop > 400) { $('.back-top').fadeIn(); } else { $('.back-top').fadeOut(); }; }); $('.back-top').on('click', function () { $('html,body').stop().animate({ 'scrollTop': 0 }, 500); }); // 浜у搧璇︽儏-閫夐」鍗″垏鎹 $('.pro-detail-tab').off('click').on('click', 'li', function () { $(this).addClass('cur').siblings().removeClass('cur'); $('.pro-content-item').eq($(this).index()).stop(true, true).fadeIn(300).siblings().hide(); }).find('li').each(function () { if ($(this).hasClass('cur')) { $('.pro-content-item').eq($(this).index()).stop(true, true).fadeIn(300); } }); // 鏈嶅姟涓庢敮鎸?鏈嶅姟缃戠偣 $('.services-network').off('click').on('click', 'li', function () { if ($(this).find('.services-network-info').is(':hidden')) { $(this).addClass('cur').find('.d-address').stop(true, true).slideUp(300).siblings('.services-network-info').stop(true, true).slideDown(300); $(this).siblings().removeClass('cur').find('.d-address').stop(true, true).slideDown(300).siblings('.services-network-info').stop(true, true).slideUp(300); } else { $(this).removeClass('cur').find('.d-address').stop(true, true).slideDown(300).siblings('.services-network-info').stop(true, true).slideUp(300); } }); // 甯歌闂甯︽悳绱㈡寜閽 $('.public-title-search').off('click').on('click', '.public-title-search-toggle', function () { if ($('.public-title-form').is(':hidden')) { $('.public-title-form').stop(true, true).slideDown(300); } else { $('.public-title-form').stop(true, true).slideUp(300); } }); //animated鍒濆鍖 if (typeof WOW != 'undefined') { var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 0, mobile: false, live: true }); wow.init(); } //杞挱鍥鹃泦鍚 if (typeof Swiper != 'undefined') { //棣栭〉banner var inBanSW = new Swiper('.inbanner-swiper', { speed: 1200, autoplayDisableOnInteraction: false, watchOverflow: true, simulateTouch: false, autoplay: 4000, pagination: '.inban-page', prevButton: '.inban-prev', nextButton: '.inban-next', loop: true, paginationClickable: true, parallax: true, onInit: function (swiper) { wow.init(); $('.inbanner-swiper .swiper-slide-active').find('.fadebox').addClass('fadeInUp'); if ($('.inbanner-swiper').find('.swiper-slide').length < 2) { $('.inban-prev,.inban-next,.inban-page').hide(); } }, onTransitionStart: function (swiper) { $('.inbanner-swiper .swiper-slide-active').find('.fadebox').addClass('fadeInUp'); $('.inbanner-swiper .swiper-slide-active').siblings().find('.fadebox').removeClass('fadeInUp'); } }); //鍐呴〉banner var sideBanSW = new Swiper('.side-banner-swiper', { speed: 1200, autoplayDisableOnInteraction: false, watchOverflow: true, simulateTouch: false, autoplay: 4500, pagination: '.side-banner-page', paginationClickable: true, effect : 'fade', onInit: function (swiper) { if ($('.side-banner-swiper').find('.swiper-slide').length < 2) { $('.side-banner-page').hide(); } } }); //棣栭〉鏂规杞挱 var inprogrammeSW = new Swiper('.inprogrammer-swiper', { speed: 1200, simulateTouch: false, pagination: '.inprogrammer-page', slidesPerView: 3, breakpoints: { 768: { slidesPerView: 1 }, 1024: { slidesPerView: 2 } } }); //棣栭〉妗堜緥灞曠ず var incaseSW = new Swiper('.incase-swiper', { speed: 1200, simulateTouch: false, slidesPerView: 2.06, spaceBetween: 47, centeredSlides: true, loop: true, loopAdditionalSlides: 1, prevButton: '.incase-prev', nextButton: '.incase-next', pagination: '.incase-page', breakpoints: { 1024: { slidesPerView: 1, spaceBetween: 10 }, 1460: { slidesPerView: 1.5, spaceBetween: 25 }, 1660: { slidesPerView: 1.8, spaceBetween: 25 } }, onInit: function (swiper) { if ($(window).width() > 1200) { var _activeW = $('.incase-box .swiper-slide-active').width() + 94 } else if ($(window).width() > 1024) { var _activeW = $('.incase-box .swiper-slide-active').width() + 50 } else { var _activeW = $('.incase-box .swiper-slide-active').width() + 20 } var _swiperBtnW = ($('.incase-box').width() - _activeW) / 2 // $('.incase-prev,.incase-next').css('width', _swiperBtnW) $('.incase-prev,.incase-next').css({ 'width': _swiperBtnW }); } }); //浜у搧璇︽儏-鍟嗗搧鍥 var prodetailSW = new Swiper('.pro-detail-swiper', { speed: 1200, autoplayDisableOnInteraction: false, watchOverflow: true, simulateTouch: false, pagination: '.pro-detail-page', prevButton: '.pro-detail-prev', nextButton: '.pro-detail-next', paginationClickable: true, onInit: function (swiper) { if ($('.pro-detail-swiper').find('.swiper-slide').length < 2) { $('.pro-detail-prev,.pro-detail-next,.pro-detail-page').hide(); } } }); //浜у搧璇︽儏-瑙e喅鏂规 var prosolutionSW = new Swiper('.pro-solution-swiper', { speed: 1200, autoplayDisableOnInteraction: false, watchOverflow: true, simulateTouch: false, pagination: '.pro-solution-page', prevButton: '.pro-solution-prev', nextButton: '.pro-solution-next', spaceBetween: 13, slidesPerView: 4, paginationClickable: true, onInit: function (swiper) { if ($('.pro-solution-swiper').find('.swiper-slide').length < 2) { $('.pro-solution-prev,.pro-solution-next,.pro-solution-page').hide(); } }, breakpoints: { 768: { slidesPerView: 1 }, 1024: { slidesPerView: 2 }, 1200: { slidesPerView: 3 } } }); //浜у搧璇︽儏-鐩稿叧浜у搧鎺ㄨ崘 var prosolutionSW = new Swiper('.pro-recommend-swiper', { speed: 1200, autoplayDisableOnInteraction: false, watchOverflow: true, simulateTouch: false, pagination: '.pro-recommend-page', prevButton: '.pro-recommend-prev', nextButton: '.pro-recommend-next', spaceBetween: 13, slidesPerView: 4, paginationClickable: true, onInit: function (swiper) { if ($('.pro-recommend-swiper').find('.swiper-slide').length < 2) { $('.pro-recommend-prev,.pro-recommend-next,.pro-recommend-page').hide(); } }, breakpoints: { 768: { slidesPerView: 1 }, 1024: { slidesPerView: 2 }, 1200: { slidesPerView: 3 } } }); //濂ュ▉浜氭枃鍖 var cultureSW = new Swiper('.culture-swiper', { speed: 1200, pagination: '.culture-page', prevButton: '.culture-prev', nextButton: '.culture-next', spaceBetween: 0, observer: true, observeParents: true, grabCursor: true, slidesPerView: 1.224, loop: true, loopAdditionalSlides: 1, breakpoints: { 1023: { spaceBetween: 5, slidesPerView: 1, } } }); //瑙e喅鏂规璇︽儏-鏂规浼樺娍 var solutionDetailSW = new Swiper('.solution-detail-swiper', { speed: 1200, simulateTouch: false, spaceBetween: 54, slidesPerView: 4, pagination: '.solution-detail-page', prevButton: '.solution-detail-prev', nextButton: '.solution-detail-next', breakpoints: { 768: { spaceBetween: 10, slidesPerView: 2 }, 1024: { spaceBetween: 20, slidesPerView: 3 }, 1200: { spaceBetween: 35, slidesPerView: 4 }, }, onInit: function (swiper) { if ($('.solution-detail-swiper').find('.swiper-slide').length > 4) { $('.solution-detail-prev,.solution-detail-next').show(); } } }); // 瑙e喅鏂规璇︽儏-鏂规搴旂敤 var solutionApplicationSW = new Swiper('.solution-application-swiper', { observer: true, centeredSlides: true, observeParents: true, watchSlidesProgress: true, watchSlidesVisibility: true, prevButton: '.application-prev', nextButton: '.application-next', slidesPerView: 'auto', // TODO: 鏍峰紡璁剧疆 slide鐨勫搴 loop: true, loopedSlides: 3, breakpoints: { // 娉? slidesPerView 鍙负灏忔暟锛屼袱杈规埅鍙 1200: { slidesPerView: 1.7, }, 1023: { slidesPerView: 1.8, }, 640: { slidesPerView: 1.26, }, }, onProgress: function (swiper) { var _stepTranslate = 0; // default:0,鍒囨崲閫氳繃 swiper-wrapper鍋忕Щ var _stepScale = 1; // default:1, 涓嶇缉鏀 var _scaleFactor = 1; // 鍒嗘瘝 var rec3d_w = $('.solution-application-swiper').width(); if ($(window).width() > 1200) { if (swiper.currentBreakpoint === 'max') { // pc | click // 璋冩暣鏄剧ず涓ょ淇敼 870 杩欎釜鍊 _stepTranslate = (450 * 3 - 870) / 2 / 2; _scaleFactor = 1 / (1 - (300 / 450)); // 1 - 1/? = 447 / 700 TODO: clientWidth/orginwidth } else { // mobole | touch length锛歞efault = 3 TODO: 鎵嬫満绔粯璁や笁涓紝缂╂斁姣斾緥鐢 slidesPerView 鍐冲畾 console.log(2) _stepScale = (3 - swiper.params.slidesPerView) / 2; _scaleFactor = 1 / (1 - _stepScale); // 鏄剧ず涓棿閮ㄥ垎 // _stepTranslate = (rec3d_w * 3 / swiper.params.slidesPerView - rec3d_w) / 4; // 榛樿宸﹀彸涓よ竟鏄剧ず涓€鍗 // 鏄剧ず涓ょ閮ㄥ垎 _stepTranslate = _stepScale * rec3d_w - (rec3d_w / swiper.params.slidesPerView) * (swiper.params.slidesPerView - 1) / 2; // 榛樿宸﹀彸涓よ竟鏄剧ず涓€鍗 } } else { if (swiper.currentBreakpoint === 'max') { // pc | click _stepTranslate = (450 * 3 - 1000) / 2 / 2; _scaleFactor = 1 / (1 - (267 / 450)); // 1 - 1/? = 447 / 700 TODO: clientWidth/orginwidth } else { // mobole | touch length锛歞efault = 3 TODO: 鎵嬫満绔粯璁や笁涓紝缂╂斁姣斾緥鐢 slidesPerView 鍐冲畾 _stepScale = (3 - swiper.params.slidesPerView) / 2; _scaleFactor = 1 / (1 - _stepScale); // 鏄剧ず涓棿閮ㄥ垎 _stepTranslate = (rec3d_w * 3 / swiper.params.slidesPerView - rec3d_w) / 4; // 榛樿宸﹀彸涓よ竟鏄剧ず涓€鍗 // 鏄剧ず涓ょ閮ㄥ垎 // _stepTranslate = _stepScale * rec3d_w - (rec3d_w / swiper.params.slidesPerView) * (swiper.params.slidesPerView - 1) / 2; // 榛樿宸﹀彸涓よ竟鏄剧ず涓€鍗 } } console.log(1); _stepTranslate = _stepTranslate || 225; // 璁$畻 1/4 for (i = 0; i < swiper.slides.length; i++) { var slide = swiper.slides.eq(i); var slideProgress = swiper.slides[i].progress; modify = 1; if (Math.abs(slideProgress) > 1) { modify = (Math.abs(slideProgress) - 1) * 0.3 + 1; } translate = slideProgress * modify * _stepTranslate + 'px'; // 鍋忕Щ: (orginwidth*3 - containerWidth)/2/2 scale = 1 - Math.abs(slideProgress) / _scaleFactor; // 缂╂斁姣斾緥闃舵锛 (clientWidth/orginWidth)锛 1 64 28 step = 36 zIndex = 999 - Math.abs(Math.round(10 * slideProgress)); slide.transform('translateX(' + translate + ') scale(' + scale + ')'); slide.css('zIndex', zIndex); slide.css('opacity', 1); if (Math.abs(slideProgress) > 3) { slide.css('opacity', 0); } } }, onSetTransition: function (swiper, transition) { for (var i = 0; i < swiper.slides.length; i++) { var slide = swiper.slides.eq(i); slide.transition(transition); } } }); //瑙e喅鏂规璇︽儏-鏍稿績浜у搧 var coreSW = new Swiper('.core-swiper', { speed: 1200, simulateTouch: false, spaceBetween: 75, slidesPerView: 3, pagination: '.core-page', prevButton: '.core-prev', nextButton: '.core-next', breakpoints: { 768: { spaceBetween: 15, slidesPerView: 1 }, 1024: { spaceBetween: 30, slidesPerView: 2 }, 1400: { spaceBetween: 50, slidesPerView: 3 }, }, onInit: function (swiper) { if ($('.core-swiper').find('.swiper-slide').length > 3) { $('.core-prev,.core-next').show(); } } }); //瑙e喅鏂规璇︽儏-鏂规搴旂敤2 var solutionApplication2SW = new Swiper('.solution-application2-swiper', { speed: 1200, simulateTouch: false, spaceBetween: 5, pagination: '.application2-page', prevButton: '.application2-prev', nextButton: '.application2-next', }); // 鍏充簬濂ュ▉浜?鍏泭琛屽姩 var welfareSW = new Swiper('.welfare-swiper', { observer: true, centeredSlides: true, observeParents: true, watchSlidesProgress: true, watchSlidesVisibility: true, prevButton: '.welfare-prev', nextButton: '.welfare-next', slidesPerView: 'auto', // TODO: 鏍峰紡璁剧疆 slide鐨勫搴 loop: true, loopedSlides: 3, breakpoints: { // 娉? slidesPerView 鍙负灏忔暟锛屼袱杈规埅鍙 1200: { slidesPerView: 1.7, }, 1023: { slidesPerView: 1.8, }, 640: { slidesPerView: 1.26, }, }, onProgress: function (swiper) { var _stepTranslate = 0; // default:0,鍒囨崲閫氳繃 swiper-wrapper鍋忕Щ var _stepScale = 1; // default:1, 涓嶇缉鏀 var _scaleFactor = 1; // 鍒嗘瘝 var rec3d_w = $('.welfare-swiper').width(); if ($(window).width() > 1200) { if (swiper.currentBreakpoint === 'max') { // pc | click _stepTranslate = (800 * 3 - 600) / 2 / 2; _scaleFactor = 1 / (1 - (500 / 800)); // 1 - 1/? = 447 / 700 TODO: clientWidth/orginwidth } else { // mobole | touch length锛歞efault = 3 TODO: 鎵嬫満绔粯璁や笁涓紝缂╂斁姣斾緥鐢 slidesPerView 鍐冲畾 _stepScale = (3 - swiper.params.slidesPerView) / 2; _scaleFactor = 1 / (1 - _stepScale); // 鏄剧ず涓棿閮ㄥ垎 // _stepTranslate = (rec3d_w * 3 / swiper.params.slidesPerView - rec3d_w) / 4; // 榛樿宸﹀彸涓よ竟鏄剧ず涓€鍗 // 鏄剧ず涓ょ閮ㄥ垎 _stepTranslate = _stepScale * rec3d_w - (rec3d_w / swiper.params.slidesPerView) * (swiper.params.slidesPerView - 1) / 2; // 榛樿宸﹀彸涓よ竟鏄剧ず涓€鍗 } } else { if (swiper.currentBreakpoint === 'max') { // pc | click _stepTranslate = (800 * 3 - 1200) / 2 / 2; _scaleFactor = 1 / (1 - (500 / 800)); // 1 - 1/? = 447 / 700 TODO: clientWidth/orginwidth } else { // mobole | touch length锛歞efault = 3 TODO: 鎵嬫満绔粯璁や笁涓紝缂╂斁姣斾緥鐢 slidesPerView 鍐冲畾 _stepScale = (3 - swiper.params.slidesPerView) / 2; _scaleFactor = 1 / (1 - _stepScale); // 鏄剧ず涓棿閮ㄥ垎 _stepTranslate = (rec3d_w * 3 / swiper.params.slidesPerView - rec3d_w) / 4; // 榛樿宸﹀彸涓よ竟鏄剧ず涓€鍗 // 鏄剧ず涓ょ閮ㄥ垎 // _stepTranslate = _stepScale * rec3d_w - (rec3d_w / swiper.params.slidesPerView) * (swiper.params.slidesPerView - 1) / 2; // 榛樿宸﹀彸涓よ竟鏄剧ず涓€鍗 } } _stepTranslate = _stepTranslate || 225; // 璁$畻 1/4 for (i = 0; i < swiper.slides.length; i++) { var slide = swiper.slides.eq(i); var slideProgress = swiper.slides[i].progress; modify = 1; if (Math.abs(slideProgress) > 1) { modify = (Math.abs(slideProgress) - 1) * 0.3 + 1; } translate = slideProgress * modify * _stepTranslate + 'px'; // 鍋忕Щ: (orginwidth*3 - containerWidth)/2/2 scale = 1 - Math.abs(slideProgress) / _scaleFactor; // 缂╂斁姣斾緥闃舵锛 (clientWidth/orginWidth)锛 1 64 28 step = 36 zIndex = 999 - Math.abs(Math.round(10 * slideProgress)); slide.transform('translateX(' + translate + ') scale(' + scale + ')'); slide.css('zIndex', zIndex); slide.css('opacity', 1); if (Math.abs(slideProgress) > 3) { slide.css('opacity', 0); } } }, onSetTransition: function (swiper, transition) { for (var i = 0; i < swiper.slides.length; i++) { var slide = swiper.slides.eq(i); slide.transition(transition); } } }); } var Fun = function () { var _winW = $(window).width(); var overscroll = window.innerWidth - document.body.clientWidth; $('.head-subnav,.p-head-bg').hide(); if (_winW + overscroll >= 1024) { // 閲嶇疆 // $('nav').show(); $('.toggle-btn').removeClass('cur') $('nav,.public-subNav,.public-tab').show(); //瀵艰埅婊戝姩鏁堟灉 $('.wrap-line').css({ 'left': $('nav li').eq($('nav .cur').index()).position().left, //.wrap-line 鐨勫畾浣嶇瓑浜庣涓€涓猯i鐨勫畾浣 'width': $('nav li').eq($('nav .cur').index()).find('h3').outerWidth() //.wrap-line 鐨勫搴︾瓑浜庣涓€涓猯i鐨勫搴 }); // nav 绉诲嚭浜嬩欢 $('nav').on('mouseleave', function () { // $('.p-head-bg').stop(true, true).slideUp(300); $('.p-head-bg').stop(true, true).animate({ height: '0' }, 200); }); // 瀵艰埅绉诲叆浜嬩欢 $('nav li').off('mouseenter mouseleave').hover( function () { /*鑷畾涔夊姩鐢?/ //榧犳爣绉诲叆瑙﹀彂鐨勫姩鐢 $('.wrap-line').stop().animate({ left: $(this).position().left, //.wrap-line 鐨勫畾浣嶇瓑浜庡綋鍓 li 鐨勫畾浣 width: $(this).find('h3').outerWidth() //.wrap-line 鐨勫搴︾瓑浜庡綋鍓 li 鐨勫搴 }); $(this).find('.head-subnav').stop(true, true).fadeIn(); $(this).siblings().find('.head-subnav').stop(true, true).hide(); if ($(this).find('.head-subnav a').length) { $('.p-head-bg').stop(true, true).slideDown(300); try { var _h = $(this).find('.head-subnav').outerHeight(); $('.p-head-bg').stop(true, true).animate({ height: _h }, 200); } catch (e) {} } else { $('.p-head-bg').stop(true, true).slideUp(300); } }, function () { //榧犳爣绉诲紑瑙﹀彂鐨勫姩鐢 $('.wrap-line').stop().animate({ left: $('nav li').eq($('nav .cur').index()).position().left, //.wrap-line 鐨勫畾浣嶇瓑浜庣涓€涓 li 鐨勫畾浣 width: $('nav li').eq($('nav .cur').index()).find('h3').outerWidth() //.wrap-line 鐨勫搴︾瓑浜庣涓€涓 li 鐨勫搴 }); $(this).find('.head-subnav').stop(true, true).hide(); } ) // 澶撮儴鎼滅储妗嗙Щ鍏ヤ簨浠 $('.search-toggle-btn').off('mouseenter mouseleave').hover(function () { if ($(this).siblings('.search-box').is(':hidden')) { $(this).siblings('.search-box').stop(true, true).slideDown(300); } }, function () {}); $('.search').on('mouseleave', function () { console.log(123); $(this).find('.search-box').stop(true, true).slideUp(300); }); } else { // 閲嶇疆 $('nav,.public-subNav,.foot-subnav').hide(); $('nav li,.foot-nav li').removeClass('active'); // 澶撮儴瀵艰埅鐐瑰嚮 $('.toggle-btn').off('click').on('click', function () { $('.search-box').hide(); if ($('nav').is(':hidden')) { $('nav').stop(true, true).slideDown(300); $(this).addClass('cur'); } else { $('nav').stop(true, true).slideUp(); $(this).removeClass('cur'); } }); // 澶撮儴鎼滅储妗嗙偣鍑 $('.search-toggle-btn').off('click').on('click', function () { $('nav').hide(); $('.toggle-btn').removeClass('cur'); if ($(this).siblings('.search-box').is(':hidden')) { $(this).siblings('.search-box').stop(true, true).slideDown(300); } else { $(this).siblings('.search-box').stop(true, true).slideUp(300); } }); //鎵嬫満绔簳閮ㄥ鑸樉绀?闅愯棌 toggleNav('.foot-nav', 'li i', '.foot-subnav', '.foot-nav li', '.foot-subnav a'); //鎵嬫満绔鑸樉绀?闅愯棌 toggleNav('nav', 'li i', '.head-subnav', 'nav li', '.head-subnav a'); // 鍐呴〉浜岀骇瀵艰埅鏄剧ず/闅愯棌 $('.public-nav-btn').off('click').on('click', function () { if ($(this).siblings('.public-subNav').is(':hidden')) { $(this).siblings('.public-subNav').stop(true, true).slideDown(300); } else { $(this).siblings('.public-subNav').stop(true, true).slideUp(); } }); // 鍒ゆ柇鍐呴〉鏄惁鏈変簩绾у鑸 if ($('.public-tab li').length > 1) { $('.public-tab').show(); } } }; Fun(); $(window).resize(function () { Fun(); if ($(window).width() >= 1024) { var _activeW = $('.team-content .swiper-slide-active').width() + 48 } else { var _activeW = $('.team-content .swiper-slide-active').width() + 20 } var _swiperBtnW = ($('.team-content').width() - _activeW) / 2 $('.team-prev,.team-next').css('width', _swiperBtnW); }); //鏁板瓧婊氬姩 function numscroll(e) { var i = e.parents("div").offset().top, t = e.attr("bolExec"); $(document).scrollTop() > i - 3 * $(window).height() / 4 && !t && (! function () { e.text(e.text().replace(".", "")); var i = 0, t = e.text() - 0, n = (t + "").length, s = setInterval(function () { i++; for (var o = parseInt(t / 100 * i), a = "", l = 0; l < n - (o + "").length; l++) a += 0; e.text(a + Number(o)); if (i >= 100) { e.text(e.attr("rel")); clearInterval(s) } }, 10); }(), e.attr("bolExec", !0)) } // 婊氬姩鍒版寚瀹氫綅缃 function scrollToLocation() { if (!$('.public-tab-area').length) { return; } var mainContainer = $('.public-tab-area'), scrollToContainer = mainContainer.find('a.cur');//婊氬姩鍒?div id="thisMainPanel">涓被鍚嶄负son-panel鐨勬渶鍚庝竴涓猟iv澶 //scrollToContainer = mainContainer.find('.son-panel:eq(5)');//婊氬姩鍒?div id="thisMainPanel">涓被鍚嶄负son-panel鐨勭鍏釜澶 //闈炲姩鐢绘晥鏋 // mainContainer.scrollLeft( // scrollToContainer.offset().left - mainContainer.offset().left + mainContainer.scrollLeft() // ); //鍔ㄧ敾鏁堟灉 //0.5绉掓粦鍔ㄥ埌鎸囧畾浣嶇疆 mainContainer.animate({ scrollLeft: scrollToContainer.offset().left - mainContainer.offset().left + mainContainer.scrollLeft() }, 500); } scrollToLocation(); //椤甸潰婊氬姩 function winScroll() { var t_top = $(window).scrollTop(); $(".num").each(function (i) { var wrapTop = $(this).offset().top; if (t_top > wrapTop - 800) { numscroll($(this)); } }); } winScroll(); }); (function ($) { $.uaMatch = function (ua) { ua = ua.toLowerCase(); var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || /(webkit)[ \/]([\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) || ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || []; return { browser: match[1] || "", version: match[2] || "0" }; }; if (!$.browser) { matched = $.uaMatch(navigator.userAgent); browser = {}; if (matched.browser) { browser[matched.browser] = true; browser.version = matched.version; } // Chrome is Webkit, but Webkit is also Safari. if (browser.chrome) { browser.webkit = true; } else if (browser.webkit) { browser.safari = true; } $.browser = browser; } $(document).on('click', 'a#goon', function () { $("#ie-alert-overlay").hide(); $("#ie-alert-panel").hide(); }); function initialize($obj, support, title, text) { var panel = "" + title + "" + "

" + text + "

" + "
" + "
"; var overlay = $("
"); var iepanel = $("
" + panel + "
"); var docHeight = $(document).height(); overlay.css("height", docHeight + "px"); if (support === "ie9") { // ie9- if ($.browser.msie && parseInt($.browser.version, 10) < 10) { $obj.prepend(iepanel); $obj.prepend(overlay); } if ($.browser.msie && parseInt($.browser.version, 10) === 6) { $("#ie-alert-panel").css("background-position", "-626px -116px"); $obj.css("margin", "0"); } } else if (support === "ie8") { // ie8- if ($.browser.msie && parseInt($.browser.version, 10) < 9) { $obj.prepend(iepanel); $obj.prepend(overlay); } if ($.browser.msie && parseInt($.browser.version, 10) === 6) { $("#ie-alert-panel").css("background-position", "-626px -116px"); $obj.css("margin", "0"); } } else if (support === "ie7") { // ie7- if ($.browser.msie && parseInt($.browser.version, 10) < 8) { $obj.prepend(iepanel); $obj.prepend(overlay); } if ($.browser.msie && parseInt($.browser.version, 10) === 6) { $("#ie-alert-panel").css("background-position", "-626px -116px"); $obj.css("margin", "0"); } } else if (support === "ie6") { // ie6- if ($.browser.msie && parseInt($.browser.version, 10) < 7) { $obj.prepend(iepanel); $obj.prepend(overlay); $("#ie-alert-panel").css("background-position", "-626px -116px"); $obj.css("margin", "0"); } } }; $.fn.iealert = function (options) { var defaults = { support: "ie9", title: '\u6e29\u99a8\u63d0\u793a\uff1a\u60a8\u4f7f\u7528\u7684\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u8bf7\u5347\u7ea7\u6d4f\u89c8\u5668\uff01', text: "\u4e3a\u4e86\u66f4\u597d\u7684\u7f51\u7ad9\u6d4f\u89c8\u4f53\u9a8c\u002c\u6211\u4eec\u5f3a\u70c8\u5efa\u8bae\u60a8\u5347\u7ea7\u5230\u6700\u65b0\u7248\u672c\u7684\u0049\u006e\u0074\u0065\u0072\u006e\u0065\u0074\u0020\u0045\u0078\u0070\u006c\u006f\u0072\u0065\u0072\u6216\u9009\u62e9\u5176\u4ed6\u4e3b\u6d41\u6d4f\u89c8\u5668\u3002\u63a8\u8350\u4f7f\u7528\u4e0b\u5217\u4e3b\u6d41\u6d4f\u89c8\u5668\uff1a

>>>\u7EE7\u7EED\u8BBF\u95EE" }; var option = $.extend(defaults, options); return this.each(function () { if ($.browser.msie) { var $this = $(this); initialize($this, option.support, option.title, option.text); } }); }; })(jQuery); $(document).ready(function () { $("body").iealert(); }); $(function () { }); //瀵艰埅楂樹寒 $(function(){ $(".nav-ul a").each(function() { if ($(this)[0].href == String(window.location)) { $(this).parents(".nav-ul>li").addClass("cur"); } }); }); /* $(window).resize(function(){ if($(window).width()> 1200){ } })*/ /* $(window).scroll(function () { var _headTop = $(window).scrollTop(); if (_headTop > 51) { $('.headerfixed').css("position","fixed"); $('.header-top ').hide(); } else { $('.headerfixed').css("position","relative"); $('.header-top ').show(); }; });*/