// 顶部导航效果 //top fixed $(window).scroll(function () { if ($(window).scrolltop() > 0) { $('#c_navigation_006_p_093-16488653441420').addclass('active') } else { $('#c_navigation_006_p_093-16488653441420').removeclass('active') } }); $('#c_navigation_006_p_093-16488653441420').mouseenter(function () { $('#c_navigation_006_p_093-16488653441420').addclass('active') }).mouseleave(function () { if ($(window).scrolltop() == 0) { $('#c_navigation_006_p_093-16488653441420').removeclass('active') } }); //language $(".head_lan .lan_con").hover(function () { $(this).find(".lan_list").addclass("cur"); }, function () { $(this).find(".lan_list").removeclass("cur"); }); // 首页轮播大图 $(function () { var swiperflag = false; var wyzvido = new swiper('.e_bannera-2 .swiper-container', { autoplay: { delay: 6000, stoponlastslide: false, disableoninteraction: true, }, speed: 1200, loop: true, navigation: { nextel: '.e_bannera-2 .p_btn_next ', prevel: '.e_bannera-2 .p_btn_prev ', }, pagination: { el: '.e_bannera-2 .p_pagenation', clickable: true, }, // 切换完毕事件 on: { init: function () { }, slidechangetransitionend: function () { var _this = $('.e_bannera-2 .swiper-container .swiper-slide').eq(this.activeindex); // 执行一下 if (!swiperflag) { swiperflag = true; } else { videoselect(_this); } } } }); videoselect($('.e_bannera-2 .swiper-container .swiper-slide.swiper-slide-active')); function videoselect(_this) { var cc = _this.find('.videocontent .video').length; console.log(cc); if (cc) { wyzvido.autoplay.stop(); _this.find('.videocontent .video').trigger('play'); _this.find('video').bind('ended', function () { wyzvido.slidenext(); wyzvido.autoplay.start(); }); } } }); // 首页产品分类 $(function () { var gallerythumbs = new swiper('#c_static_001_p_505-16488613045120 .pro_thum', { slidesperview: 7, freemode: false, watchslidesvisibility: true, watchslidesprogress: true, breakpoints: { 768: { slidesperview: 3, centeredslides: false } }, observer: true, observeparents: true, resistanceratio: 0, }); var gallerytop = new swiper('#c_static_001_p_506-16488613247520 .pro_cont', { loop: true, loopedslides: 3, slideactiveclass: 'active', speed: 800, slidesperview: 1.5, spacebetween: 0, centeredslides: true, breakpoints: { 768: { slidesperview: 1, spacebetween: 0 } }, navigation: { nextel: '#c_static_001_p_506-16488613247520 .pro_btn .swiper-button-next', prevel: '#c_static_001_p_506-16488613247520 .pro_btn .swiper-button-prev', }, thumbs: { swiper: gallerythumbs, thumbscontainerclass: 'my-container-active', }, pagination: { el: '#c_static_001_p_506-16488613247520 .swiper-pagination', clickable: true, }, observer: true, observeparents: true, }); }); // 首页公司优势轮播图 $(function () { $('#myroundabout').roundabout({ duration: 500, minopacity: 1, enabledrag: true, minscale: 1, dragfactor: 1, btnprev: '.arr_btn_prev', btnnext: '.arr_btn_next' }); $('.arr_btn02_l').click(function (event) { $('.arr_btn_prev').trigger('click'); }); $('.arr_btn02_r').click(function (event) { $('.arr_btn_next').trigger('click'); }); }); // 内页轮播大图模糊效果 $(window).scroll(function (e) { var scrollseviye = $(this).scrolltop(); if (scrollseviye > 2400) { scrollseviye = 2400; } var buyutme = (scrollseviye / 6000) + 1; $('.e_bannera-1 .p_img img').css('-webkit-filter', 'blur(' + scrollseviye / 120 + 'px)'); $('.e_bannera-1 .p_img img').css('transform', 'scale(' + buyutme + ')'); }); // 内页内容分类 $(function () { var urlname = window.location.pathname; $('.e_container-1 .p_list .p_loopitem .s_title a').each(function () { var urlhref = $(this).attr('href'); if (urlname.indexof(urlhref) >= 0) { $(this).addclass('on'); $(this).parent().parent("div").addclass('active'); } }); if ($(window).width() < 769) { if ($('.e_container-1 .p_list .p_loopitem.active').length > 0) { var left = $('.e_container-1 .p_list .p_loopitem.active').offset().left; console.log(left) console.log($(window).width() / 2) if (left > ($(window).width() / 2)) { $(".e_container-1 .p_list").scrollleft(left / 2); } } } });