! function() { function setfontsize() { var w = document.documentelement.clientwidth; w = w > 768 ? 768 : w; if (w < 768) document.documentelement.style.fontsize = w / 16 + 'px'; } var t = null; window.addeventlistener("resize", function() { cleartimeout(t); t = settimeout(setfontsize, 100); var ww = $(window).width(); if (ww < 768) { var tsrc = $('.art img').attr('src'); $('.art').css({ 'background-image': "url(" + tsrc + ")" }); $('.xwxq img').css('height','auto') $('.xwxq img').attr('height','auto') } else { $('.art').css({ 'background-image': "none" }); } }, false); setfontsize(); }(window); $(function() { var ww = $(window).width(); $('.nav').append("
"); $('.nav .close').click(function() { $('.nav').hide(); }); if (ww < 768) { var tsrc = $('.art img').attr('src'); $('.art').css({ 'background-image': "url(" + tsrc + ")" }); $('.xwxq img').css('height','auto') $('.xwxq img').attr('height','auto') } $('.backtop').click(function() { $('body,html').animate({ scrolltop: 0 }, 1000); }); $('.mouse').click(function() { $('body,html').animate({ scrolltop: $('.about').position().top + 'px' }, 1000); }); $('.nbanner').addclass('active'); $('.flink').click(function() { if (!$(this).hasclass('active')) { $('.flist').stop(true, false).fadein(600); $(this).addclass('active'); } else { $('.flist').stop(true, false).fadeout(600); $(this).removeclass('active'); } }); if ($('.qywh').length > 0) { $('.mbg').css({ 'background': '#fafafa' }); } // var bannercswiper = new swiper(".banner .swiper-container", { // pagination: ".banner .swiper-pagination", // paginationclickable: true, // prevbutton:'.banner .prev', // nextbutton:'.banner .next', // effect:'fade', // spacebetween: 0, // slidesperview: 1, // autoplay: 2000, // speed: 1000, // loop: true, // ontransitionend: function(swiper) { // } // }); if ($('.banner').length > 0) { /*banner*/ $('.banner .flexslider').flexslider({ animation: 'slide', directionnav: true, //是否显示左右方向箭头按钮 pauseonaction: false, //手动切换后是否继续自动轮播,继续(false),停止(true),默认true direction: 'horizontal', animationloop: true, //是否循环播放 slideshow: true, //是否自动滑动 slideshowspeed: 3000, // 滑动内容展示时间(ms) animationspeed: 1000, //内容切换时间(ms) touch: true, //是否支持触摸滑动 pauseonhover: true, //鼠标滑向滚动内容时,是否暂停滚动 }); } if ($('.wbanner').length > 0) { $('.wbanner .flexslider').flexslider({ animation: 'slide', directionnav: true, //是否显示左右方向箭头按钮 pauseonaction: false, //手动切换后是否继续自动轮播,继续(false),停止(true),默认true direction: 'horizontal', animationloop: true, //是否循环播放 slideshow: true, //是否自动滑动 slideshowspeed: 3000, // 滑动内容展示时间(ms) animationspeed: 1000, //内容切换时间(ms) touch: true, //是否支持触摸滑动 pauseonhover: true, //鼠标滑向滚动内容时,是否暂停滚动 }); } $(window).scroll(function() { var st = $(window).scrolltop(); // alert(st); var hh = $('.header').height(); if (st > 0) { $('.header').css({ 'background': '#fff', 'position': 'fixed', 'width': '100%', 'z-index': '2000' }); } else { $('.header').css({ 'background': 'none', 'position': '' }); } }); $('.nav ul li').each(function() { if (ww < 768) { // if($(this).find('dl dd a').length>0){ // $(this).find('>a').attr('href','#'); // } } }); // $('.nav ul li').click(function(){ // if(ww<768){ // if($(this).find('dl dd a').length>0){ // $(this).addclass('active').siblings().removeclass('active'); // $(this).find('dl').slidedown(600).parent().siblings().find('dl').slideup(600); // } // else{ // $(this).removeclass('active'); // $(this).find('dl').slideup(600); // } // } // }); $('.menu').click(function() { if (ww < 768) { if (!$(this).hasclass('active')) { $('.logo').addclass('active'); $('.oa').addclass('active'); $(this).addclass('active'); $('.nav').fadein(600); } else { $('.logo').removeclass('active'); $('.oa').removeclass('active'); $(this).removeclass('active'); $('.nav').fadeout(600); } } }); $('.nav ul li').hover(function() { if (ww > 768) { if ($(this).find('dl dd a').length > 0) { $(this).addclass('active').siblings().removeclass('active'); $(this).find('dl').stop(true, false).slidedown(600).parent().siblings().find('dl').stop(true, false).slideup( 600); } else { $(this).removeclass('active'); $(this).find('dl').stop(true, false).slideup(600); } } }, function() { if (ww > 768) { $(this).removeclass('active'); $(this).find('dl').stop(true, false).slideup(600); } }); var caseswiper = new swiper(".case .swiper-container", { pagination: ".case .swiper-pagination", paginationclickable: true, spacebetween: 5, slidesperview: 'auto', autoplay: 2000, speed: 1000, loop: false, ontransitionend: function(swiper) {} }); // $('.case .con ul li a').hover(function(){ // if(ww>768){ // $(this).parent().addclass('active').siblings().removeclass('active'); // $(this).parent().animate({'width':'1155px'}).siblings().animate({'width':'280px'}); // } // },function(){ // $(this).parent().removeclass('active'); // $(this).parent().animate({'width':'280px'}); // }); var honestyswiper = new swiper(".honesty .swiper-container", { pagination: ".honesty .swiper-pagination", paginationclickable: true, spacebetween: 15, slidesperview: 4, autoplay: false, speed: 1000, loop: false, ontransitionend: function(swiper) {}, breakpoints: { 768: { spacebetween: 15, slidesperview: 2, }, 1200: { spacebetween: 15, slidesperview: 4, }, } }); var newsswiper = new swiper(".news .swiper-container", { pagination: ".news .swiper-pagination", paginationclickable: true, nextbutton: '.news .change', spacebetween: 15, slidesperview: 4, autoplay: false, speed: 1000, loop: false, ontransitionend: function(swiper) {}, breakpoints: { 768: { spacebetween: 0, slidesperview: 1, slidespercolumn: 2, slidespercolumnfill: 'column', }, 1200: { spacebetween: 15, slidesperview: 4, }, } }); var smenuswiper = new swiper(".smenu .swiper-container", { spacebetween: 0, slidesperview: 10, autoplay: false, speed: 1000, loop: false, ontransitionend: function(swiper) {}, breakpoints: { 768: { spacebetween: 0, slidesperview: 'auto', }, 1200: { spacebetween: 15, slidesperview: 4, }, } }); $('.smenu ul li').click(function() { // if(ww<768){ $('.smenu ul li').removeclass('active'); $(this).addclass('active'); // } }); if (ww > 768) { if ($('.smenu ul li').length < 10) { $('.smenu ul,.smenu ul li').css({ "display": "inline-block" }); $('.smenu ul li').css({ "float": "none" }); } } else { if ($('.smenu ul li').length < 3) { $('.smenu ul,.smenu ul li').css({ "display": "inline-block" }); $('.smenu ul li').css({ "float": "none" }); } } if ($('.smenu ul li.active').index() > 0) { smenuswiper.slideto($('.smenu ul li.active').index(), 1000, false); } var zzinfoswiper = new swiper(".zzinfo dl dd .swiper-container", { spacebetween: 40, slidesperview: 1, slidespergroup: 4, slidespercolumn: 4, slidespercolumnfill: 'column', autoplay: false, speed: 1000, loop: false, ontransitionend: function(swiper) {}, breakpoints: { 768: { spacebetween: 20, slidesperview: 2, slidespercolumn: 2, slidespercolumnfill: 'column', }, } }); var ygzjswiper = new swiper(".ygzj .swiper-container", { nextbutton: '.ygzj .change', spacebetween: 40, slidesperview: 2, slidespercolumn: 2, slidespercolumnfill: 'column', autoplay: false, speed: 1000, loop: false, ontransitionend: function(swiper) {}, breakpoints: { 768: { spacebetween: 10, slidesperview: 1, slidespergroup: 3, slidespercolumn: 3, slidespercolumnfill: 'column', }, 1200: { spacebetween: 15, slidesperview: 4, }, } }); if (ww > 768) { $('.gltx .info .title').text($('.gltx .ctxt ul li').eq(2).find('.title').text()); $('.gltx .info .desc').html($('.gltx .ctxt ul li').eq(2).find('.desc').html()); } else { $('.gltx .info .title').text($('.gltx .ctxt ul li').eq(1).find('.title').text()); $('.gltx .info .desc').html($('.gltx .ctxt ul li').eq(1).find('.desc').html()); } var gltxswiper = new swiper(".gltx .swiper-container", { prevbutton: '.gltx .prev', nextbutton: '.gltx .next', spacebetween: 0, slidesperview: 5, centeredslides: true, initialslide: 2, autoplay: false, speed: 1000, ontransitionend: function(swiper) { $('.gltx .info .title').text($('.gltx .ctxt ul li').eq(swiper.activeindex).find('.title').text()); $('.gltx .info .desc').html($('.gltx .ctxt ul li').eq(swiper.activeindex).find('.desc').html()); }, breakpoints: { 768: { spacebetween: 0, slidesperview: 3, initialslide: 1, }, 1200: { spacebetween: 0, slidesperview: 3, initialslide: 1, }, } }); $('.gltx .ctxt ul li').click(function() { $('.gltx .info .title').text($(this).find('.title').text()); $('.gltx .info .desc').html($(this).find('.desc').html()); }); var rytopswiper = new swiper(".rytop .swiper-container", { spacebetween: 0, slidesperview: 3, centeredslides: true, centerinsufficientslides: true, initialslide: 1, autoplay: false, speed: 1000, loop: false, ontransitionend: function(swiper) {}, breakpoints: { 768: { spacebetween: 0, slidesperview: 1, } } }); $('.rybot ul li').eq(0).addclass('active').siblings().removeclass('active'); var rybotswiper = new swiper(".rybot .swiper-container", { prevbutton: '.rybot .prev', nextbutton: '.rybot .next', spacebetween: 14, slidesperview: 6, autoplay: false, speed: 1000, loop: false, ontransitionend: function(swiper) {}, breakpoints: { 768: { spacebetween: 10, slidesperview: 3, }, 1200: { spacebetween: 10, slidesperview: 4, }, } }); $('.rybot ul li').click(function() { $(this).addclass('active').siblings().removeclass('active'); rytopswiper.slideto($(this).index(), 1000, false); }); $('.simg ul li').removeclass('active'); $('.simg ul li').eq(0).addclass('active'); $('.bimg img').attr("src", $('.simg ul li').eq(0).find('.img img').attr('src')); var simgswiper = new swiper(".simg .swiper-container", { prevbutton: '.simg .prev', nextbutton: '.simg .next', spacebetween: 3, slidesperview: 4, autoplay: false, speed: 1000, ontransitionend: function(swiper) {}, }); $('.simg ul li').click(function() { $('.simg ul li').removeclass('active'); $('.simg ul li').eq($(this).index()).addclass('active'); $('.bimg img').attr("src", $(this).find('.img img').attr('src')); }); var pdlistswiper = new swiper(".pdbot .swiper-container", { prevbutton: '.pdbot .prev', nextbutton: '.pdbot .next', spacebetween: 30, slidesperview: 3, autoplay: false, speed: 1000, ontransitionend: function(swiper) {}, breakpoints: { 768: { spacebetween: 10, slidesperview: 1, slidespercolumn: 3, slidespercolumnfill: 'column', }, } }); });