$(function(){ // indexbanner // .casedatatop .cont .swiper-slide-active /*var cwt1 = -($('.casedatatop .cont .swiper-slide-active .img').width() - $('.casedatatop .cont .swiper-slide-active').width()) / 2; $('.casedatatop .cont .swiper-slide-active .img').css({'margin-left': cwt1}); var cwt2 = -($('.casedatatop .cont .wf').width() - $('.casedatatop .cont').width()) / 2; $('.casedatatop .cont .wf').css({'margin-left': cwt2});*/ /*var swiper1 = new swiper(".casedatatop .myswiper", { spacebetween: 10, slidesperview: 3, centeredslides: true, speed: 800, loop: true, freemode: true, watchslidesprogress: true, }); var swiper2 = new swiper(".casedatatop .myswiper2", { //spacebetween: 10, loop: true, speed: 800, effect: 'fade', pagination: { el: ".casedatatop .swiper-pagination", clickable: true //type: "fraction", }, navigation: { nextel: ".casedatatop .swiper-button-next", prevel: ".casedatatop .swiper-button-prev", }, thumbs: { swiper: swiper1, }, });*/ var swiper = new swiper(".casedatatop .swiper-container", { //autoplay: { delay: 3500 }, //speed: 1000, loop: true, slidesperview: 3, centeredslides: true, navigation: { nextel: ".casedatatop .swiper-button-next", prevel: ".casedatatop .swiper-button-prev", }, pagination: { el: ".casedatatop .swiper-pagination", //type: "fraction", clickable: true }/*, on:{ init: function(){ swiperanimatecache(this); //隐藏动画元素 swiperanimate(this); //初始化完成开始动画 }, slidechangetransitionend: function(){ swiperanimate(this); } }*/ }); $(".casedatatop .em1").click(function(){ $(".casedatatop .swiper-button-prev").trigger('click'); }); $(".casedatatop .em2").click(function(){ $(".casedatatop .swiper-button-next").trigger('click'); }); var ttttt = parseint($('.casenav .cont').width()) / parseint($('.casenav .cont .li').length); $('.casenav .cont .li').css({'width':ttttt}); // indexbanner if( $(window).width() > 750 ){ var swiper = new swiper(".newsbanner .swiper-container", { autoplay: { delay: 3500,//1秒切换一次 }, speed: 800, effect: 'fade', loop: true, navigation: { nextel: ".newsbanner .swiper-button-next", prevel: ".newsbanner .swiper-button-prev", }, pagination: { el: ".newsbanner .swiper-pagination", clickable: true //type: "fraction", }, on:{ init: function(){ swiperanimatecache(this); //隐藏动画元素 swiperanimate(this); //初始化完成开始动画 }, slidechangetransitionend: function(){ swiperanimate(this); } } }); } else { var swiper = new swiper(".newsbanner .swiper-container", { autoplay: { delay: 3500,//1秒切换一次 }, speed: 800, effect: 'fade', loop: true, navigation: { nextel: ".newsbanner .swiper-button-next", prevel: ".newsbanner .swiper-button-prev", }, pagination: { el: ".newsbanner .swiper-pagination", clickable: true //type: "fraction", }/*, on:{ init: function(){ swiperanimatecache(this); //隐藏动画元素 swiperanimate(this); //初始化完成开始动画 }, slidechangetransitionend: function(){ swiperanimate(this); } }*/ }); } // .indexnewsd .dian $('.indexnewsd .dian').hover(function(){ var index = $(this).index(); $('.indexnewsd .con').eq(index).addclass('one').siblings().removeclass('one'); }); // .indexmap .svgmapbox g $('.indexmap .svgmapbox g').hover(function(){ var index = $(this).index(); $('.mapimg .li').eq(index).addclass('on').siblings().removeclass('on'); }); // .indexjingdian .imgbox var swiper = new swiper(".indexjingdian .imgbox .swiper-container", { //autoplay: { delay: 3500 }, speed: 800, loop: true, slidesperview: 3, centeredslides: true, navigation: { nextel: ".indexjingdian .imgbox .swiper-button-next", prevel: ".indexjingdian .imgbox .swiper-button-prev", }, pagination: { el: ".indexjingdian .imgbox .swiper-pagination", //type: "fraction", clickable: true }, on:{ init: function(){ swiperanimatecache(this); //隐藏动画元素 swiperanimate(this); //初始化完成开始动画 }, slidechangetransitionend: function(){ swiperanimate(this); } } }); $(".indexjingdian .em1").click(function(){ $(".indexjingdian .swiper-button-prev").trigger('click'); }); $(".indexjingdian .em2").click(function(){ $(".indexjingdian .swiper-button-next").trigger('click'); }); // .shehuibanner .img var uu3 = $('.shehuibanner .img img').attr('src'); var ww3 = 'url(' + uu3 + ') no-repeat center'; $('.shehuibanner .img').css({'background':ww3,'background-size':'cover'}); // .casedatatui .listcell var swiper = new swiper(".casedatatui .listcell .swiper-container", { //autoplay: { delay: 3500 }, //speed: 1000, loop: true, //slidesperview: 3, //centeredslides: true, navigation: { nextel: ".casedatatui .listcell .swiper-button-next", prevel: ".casedatatui .listcell .swiper-button-prev", }, pagination: { el: ".casedatatui .listcell .swiper-pagination", //type: "fraction", clickable: true } }); // .aboutwenter .listcell var swiper = new swiper(".aboutwenter .listcell .swiper-container", { autoplay: { delay: 3000 }, speed: 1000, loop: true, //slidesperview: 3, //centeredslides: true, navigation: { nextel: ".aboutwenter .listcell .swiper-button-next", prevel: ".aboutwenter .listcell .swiper-button-prev", }, pagination: { el: ".aboutwenter .listcell .swiper-pagination", //type: "fraction", clickable: true } }); // .indexbanner .m $('.indexbanner .m').css({'background':'url(' + $('.indexbanner .m img').attr('src') + ') no-repeat center','background-size':'auto 100%'}); $('.indexbanner .m').addclass('on'); // .contactbox .top .m img $('.contactbox .top .m').css({'background':'url(' + $('.contactbox .top .m img').attr('src') + ') no-repeat center','background-size':'cover'}); // .contactbox .bot .m $('.contactbox .bot .m').css({'background':'url(' + $('.contactbox .bot .m img').attr('src') + ') no-repeat center','background-size':'cover'}); // .headercell .list .form .nav .tit i $('.headercell .list .form .nav .tit i').click(function(){ $(this).parent().parent().toggleclass('on'); $(this).parent().siblings('.m').slidetoggle(); }); $('.headercell .top .right .sole').click(function(){ $('.headercell .list').addclass('list2'); $('.headercell .up').show(); }); $('.headercell .list .sole, .headercell .up').click(function(){ $('.headercell .list').removeclass('list2'); $('.headercell .up').hide(); }); // .aboutmink .list .vid .play $('.aboutmink .list .vid .play, .indexbanner .icon a').click(function(){ $('.videoup').addclass('videoup2'); var myvideo=document.getelementbyid("videos"); myvideo.play(); }); $('.videoup .cont .sole').click(function(){ $('.videoup').removeclass('videoup2'); var myvideo=document.getelementbyid("videos"); myvideo.pause(); }); // .casebox .list .wli for( var vv=0;vv<=$('.casebox .list .wli').length;vv++ ){ if( $('.casebox .list .wli').eq(vv).find('.li').length <= 4 ){ $('.casebox .list .wli').eq(vv).children('.more').hide(); } else { $('.casebox .list .wli').eq(vv).children('.more').show(); } } // .casebox .list .more $('.casebox .list .more').click(function(){ $(this).parent().toggleclass('on'); $(this).toggleclass('more2'); if( $(this).children().text() === '展开全部' ){ $(this).children().text('收起'); } else { $(this).children().text('展开全部'); } }); // .newsbanner .cont .mker .m img for( var ii2=0;ii2<=$('.newsbanner .swiper-slide').length;ii2++ ){ var mmw2 = $('.newsbanner .swiper-slide').eq(ii2).find('.m').children().children('img').attr('src'); var kkw2 = 'url(' + mmw2 + ') no-repeat center'; $('.newsbanner .swiper-slide').eq(ii2).find('.m').css({'background':kkw2,'background-size':'cover'}); } // .contactbox .list .wli for( var ii3=0;ii3<=$('.contactbox .list .wli').length;ii3++ ){ var mmw3 = $('.contactbox .list .wli').eq(ii3).find('.m').children().attr('src'); var kkw3 = 'url(' + mmw3 + ') no-repeat center'; $('.contactbox .list .wli').eq(ii3).find('.m').css({'background':kkw3,'background-size':'cover'}); } // .bannerdata .img var uu1 = $('.bannerdata .img img').attr('src'); var ww1 = 'url(' + uu1 + ') no-repeat center'; $('.bannerdata .img').css({'background':ww1,'background-size':'cover'}); // .aboutrent .img var uu2 = $('.aboutrent .img img').attr('src'); var ww2 = 'url(' + uu2 + ') no-repeat center'; $('.aboutrent').css({'background':ww2,'background-size':'cover'}); // .aboutone .img // .productown .cont .mk .text .k $('.productown .cont .mk .text .k').click(function(){ $('.prodentup').addclass('prodentup2'); }); $('.prodentup .cont .sole').click(function(){ $('.prodentup').removeclass('prodentup2'); }); // indexentryu if( $(window).width() > 750 ){ var swiper = new swiper(".indexentryu .cont1 .swiper-container", { //autoplay: { delay: 3500 }, speed: 1000, loop: true, slidesperview: 5, navigation: { nextel: ".indexentryu .cont1 .swiper-button-next", prevel: ".indexentryu .cont1 .swiper-button-prev", }, pagination: { el: ".indexentryu .cont1 .swiper-pagination", type: "fraction", }, on:{ init: function(){ swiperanimatecache(this); //隐藏动画元素 swiperanimate(this); //初始化完成开始动画 }, slidechangetransitionend: function(){ swiperanimate(this); if( $('.indexentryu .bot .cont1 .swiper-pagination-current').text() < 10 ){ $('.indexentryu .bot .cont1 .more .num i').text('0'+$('.indexentryu .bot .cont1 .swiper-pagination-current').text()); } else { $('.indexentryu .bot .cont1 .more .num i').text($('.indexentryu .bot .cont1 .swiper-pagination-current').text()); } } } }); var swiper = new swiper(".indexentryu .cont2 .swiper-container", { //autoplay: { delay: 3500 }, speed: 1000, loop: true, slidesperview: 5, navigation: { nextel: ".indexentryu .cont2 .swiper-button-next", prevel: ".indexentryu .cont2 .swiper-button-prev", }, pagination: { el: ".indexentryu .cont2 .swiper-pagination", type: "fraction", }, on:{ init: function(){ //swiperanimatecache(this); //隐藏动画元素 //swiperanimate(this); //初始化完成开始动画 }, slidechangetransitionend: function(){ //swiperanimate(this); //每个slide切换结束时也运行当前slide动画 //this.slides.eq(this.activeindex).find('.ani').removeclass('ani'); 动画只展现一次,去除ani类名 if( $('.indexentryu .bot .cont2 .swiper-pagination-current').text() < 10 ){ $('.indexentryu .bot .cont2 .more .num i').text('0'+$('.indexentryu .bot .cont2 .swiper-pagination-current').text()); } else { $('.indexentryu .bot .cont2 .more .num i').text($('.indexentryu .bot .cont2 .swiper-pagination-current').text()); } } } }); } else { var swiper = new swiper(".indexentryu .cont1 .swiper-container", { //autoplay: { delay: 3500 }, speed: 1000, loop: true, slidesperview: 1, navigation: { nextel: ".indexentryu .cont1 .swiper-button-next", prevel: ".indexentryu .cont1 .swiper-button-prev", }, pagination: { el: ".indexentryu .cont1 .swiper-pagination", type: "fraction", }, on:{ init: function(){ swiperanimatecache(this); //隐藏动画元素 swiperanimate(this); //初始化完成开始动画 }, slidechangetransitionend: function(){ swiperanimate(this); if( $('.indexentryu .bot .cont1 .swiper-pagination-current').text() < 10 ){ $('.indexentryu .bot .cont1 .more .num i').text('0'+$('.indexentryu .bot .cont1 .swiper-pagination-current').text()); } else { $('.indexentryu .bot .cont1 .more .num i').text($('.indexentryu .bot .cont1 .swiper-pagination-current').text()); } } } }); var swiper = new swiper(".indexentryu .cont2 .swiper-container", { //autoplay: { delay: 3500 }, speed: 1000, loop: true, slidesperview: 1, navigation: { nextel: ".indexentryu .cont2 .swiper-button-next", prevel: ".indexentryu .cont2 .swiper-button-prev", }, pagination: { el: ".indexentryu .cont2 .swiper-pagination", type: "fraction", }, on:{ init: function(){ //swiperanimatecache(this); //隐藏动画元素 //swiperanimate(this); //初始化完成开始动画 }, slidechangetransitionend: function(){ //swiperanimate(this); //每个slide切换结束时也运行当前slide动画 //this.slides.eq(this.activeindex).find('.ani').removeclass('ani'); 动画只展现一次,去除ani类名 if( $('.indexentryu .bot .cont2 .swiper-pagination-current').text() < 10 ){ $('.indexentryu .bot .cont2 .more .num i').text('0'+$('.indexentryu .bot .cont2 .swiper-pagination-current').text()); } else { $('.indexentryu .bot .cont2 .more .num i').text($('.indexentryu .bot .cont2 .swiper-pagination-current').text()); } } } }); } // swiper-pagination-current $('.indexentryu .bot .cont1 .more .num i').text('0'+$('.indexentryu .bot .cont1 .swiper-pagination-current').text()); $('.indexentryu .bot .cont2 .more .num i').text('0'+$('.indexentryu .bot .cont2 .swiper-pagination-current').text()); if( $('.indexentryu .bot .cont1 .swiper-pagination-total').text() < 10 ){ $('.indexentryu .bot .cont1 .more .num em').text('0'+$('.indexentryu .bot .cont1 .swiper-pagination-total').text()); } else { $('.indexentryu .bot .cont1 .more .num em').text($('.indexentryu .bot .cont1 .swiper-pagination-total').text()); } if( $('.indexentryu .bot .cont2 .swiper-pagination-total').text() < 10 ){ $('.indexentryu .bot .cont2 .more .num em').text('0'+$('.indexentryu .bot .cont2 .swiper-pagination-total').text()); } else { $('.indexentryu .bot .cont2 .more .num em').text($('.indexentryu .bot .cont2 .swiper-pagination-total').text()); } // .indexentryu .bot .right .more .em swiper-button-prev .swiper-button-next $(".indexentryu .bot .cont1 .em1").click(function(){ $(".indexentryu .bot .cont1 .swiper-button-prev").trigger('click'); }); $(".indexentryu .bot .cont1 .em2").click(function(){ $(".indexentryu .bot .cont1 .swiper-button-next").trigger('click'); }); $(".indexentryu .bot .cont2 .em1").click(function(){ $(".indexentryu .bot .cont2 .swiper-button-prev").trigger('click'); }); $(".indexentryu .bot .cont2 .em2").click(function(){ $(".indexentryu .bot .cont2 .swiper-button-next").trigger('click'); }); // .indexentryu .bot .nav .li $('.indexentryu .bot .nav .li').click(function(){ $(this).addclass('on').siblings().removeclass('on'); var index = $(this).index(); $('.indexentryu .bot .wli').eq(index).addclass('on').siblings().removeclass('on'); }); // .indexbanner .num $('.indexbanner .num i').text('0'+$('.indexbanner .swiper-pagination-current').text()); if( $('.indexbanner .swiper-pagination-total').text() < 10 ){ $('.indexbanner .num em').text('0'+$('.indexbanner .swiper-pagination-total').text()); } else { $('.indexbanner .num em').text($('.indexbanner .swiper-pagination-total').text()); } // .indexbanner .swiper-slide for( var ii=0;ii<=$('.indexbanner .swiper-slide').length;ii++ ){ var mmw = $('.indexbanner .swiper-slide').eq(ii).find('.img').children().attr('src'); var kkw = 'url(' + mmw + ') no-repeat center'; $('.indexbanner .swiper-slide').eq(ii).children('.cont').css({'background':kkw,'background-size':'cover'}); } // header $(window).scroll(function(){ var scrolltop = document.documentelement.scrolltop || document.body.scrolltop; if(scrolltop > 50){ $('.header').addclass('header2'); $('.headercell .top').addclass('top2'); }else{ $('.headercell .top').removeclass('top2'); } }); // top $('.rightnavbox .bot').click(function(){ var scrolltotop = window.setinterval(function() { var mink = window.pageyoffset; if ( mink > 0 ) { window.scrollto( 0, mink - 20 ); } else { window.clearinterval( scrolltotop ); } }, 16); }); // weard .productown .cont .mk .more .li .wearup .s $('#weard').click(function(){ $('.productown .cont .mk .more .li .wearup').addclass('wearup2'); }); $('.productown .cont .mk .more .li .wearup .s').click(function(){ $('.productown .cont .mk .more .li .wearup').removeclass('wearup2'); }); // /*$('.indexdataone .navone .li').click(function() { var index = $(this).index(); if( index == 0 ){ $('html,body').animate({ scrolltop: $('.bannerdata').height() }, 500); } else if( index == 1 ){ $('html,body').animate({ scrolltop: $(".indexdataone .two").offset().top - $('.header').height() }, 500); } else if( index == 2 ){ $('html,body').animate({ scrolltop: $(".indexdataone .three").offset().top - $('.header').height() -60 }, 500); } else if( index == 3 ){ $('html,body').animate({ scrolltop: $(".indexdataone .four").offset().top - $('.header').height() }, 500); } else if( index == 4 ){ $('html,body').animate({ scrolltop: $(".indexdataone .case").offset().top - $('.header').height() }, 500); } }); $('.indexdataone .navthree .li').click(function() { var index = $(this).index(); if( index == 0 ){ $('html,body').animate({ scrolltop: $('.bannerdata').height() }, 500); } else if( index == 1 ){ $('html,body').animate({ scrolltop: $(".caseone").offset().top - $('.header').height() }, 500); } });*/ // .newsnav .cont .line .lis .m $('.newsnav .cont .line .lis .m').click(function(){ var text = $(this).text(); $('.newsnav .cont .line .input input').val(text); }); // .aboutrent .icon .der .li $('.aboutrent .icon .der .li').mouseenter(function(){ var index = $(this).index(); $('.aboutrent .cont').eq(index).addclass('on').siblings().removeclass('on'); }); // .cellnavboxer .list .nav .tit i $('.cellnavboxer .list .nav .tit i').click(function(){ $(this).parent().siblings('.m').slidetoggle(); $(this).parent().parent().toggleclass('on'); }); // .cellnavboxer .topnav .sole $('.cellnavboxer .topnav .sole').click(function(){ $('.cellnavboxer .up').show(); $('.cellnavboxer .list').addclass('list2'); }); $('.cellnavboxer .list .sole, .cellnavboxer .up, .cellnavboxer .vent .sole').click(function(){ $('.cellnavboxer .up').hide(); $('.cellnavboxer .list').removeclass('list2'); $('.cellnavboxer .vent').removeclass('vent2'); }); $('.cellnavboxer .list .nav .li:nth-child(3) .tit i').click(function(){ $('.cellnavboxer .up').show(); $('.cellnavboxer .list').removeclass('list2'); $('.cellnavboxer .vent').addclass('vent2'); $('.cellnavboxer .list .nav .li').removeclass('on'); $('.cellnavboxer .list .nav .m').slideup(); }); // transtion if (!(/msie [6|7|8|9]/i.test(navigator.useragent))){ var wow = new wow({ boxclass: 'wow', animateclass: 'animated', offset: 10, mobile: false, live: true }); wow.init(); }; });