$(function () { //导航 var off = true; $(".navtrigger").click(function () { if (off == true) { $(this).addclass("navtrigger-on"); $('.wapnav').addclass("nav_on"); off = false; } else { $(this).removeclass("navtrigger-on"); $(".wapnav").removeclass("nav_on"); off = true; } }); $('.wapnav .navsub a').click(function(){ location.reload(true); }) //搜索 $('.searbtn').click(function () { $(this).siblings().find('.info').stop().slideup(); $('.search').stop(false, true).slidetoggle(); }); $(document).bind("click", function (e) { var target = $(e.target); if (target.closest(".searbtn,.search").length == 0) { $(this).find('.search').stop().slideup(); } }); //广告轮播图 var banner = new swiper('.banner', { pagination: '.swiper-pagination', paginationclickable: true, effect: 'fade', speed: 600, autoplay:3400, loop: true, fade: { crossfade: true, }, }); $('.banner').mouseover(function () { banner.stopautoplay(); }); $('.banner').mouseout(function () { banner.startautoplay(); }); //联系地址切换 $('.address-tab .all li').mouseover(function() { $(this).addclass("on").siblings().removeclass('on'); var idx = $(this).index(); $(".address-tab .frame").eq(idx).addclass("on").siblings(".address-tab .frame").removeclass("on"); }); //优势 var product = new swiper('.promain', { speed: 500, //autoplay: 5200, effect: 'fade', fade: { crossfade: true, }, onslidechangestart: function (swiper) { $(".prol .on").removeclass('on'); $(".prol .m").eq(swiper.activeindex).addclass('on'); } }); $(".prol .m").on('mouseover', function (e) { $(".prol .on").removeclass('on'); $(this).addclass('on'); product.slideto($(this).index()); }); //解决方案 var solution = new swiper('.solutionmain ', { slidesperview:4, spacebetween:30, autoplay: 4800, loop: true, grabcursor: true, prevbutton: '.swiper-button-prev', nextbutton: '.swiper-button-next', breakpoints: { 1440: { slidesperview:3, }, 920: { slidesperview:2, }, 640: { slidesperview:1, spacebetween:20, }, } }); //行业应用 var apply = new swiper('.applymain ', { slidesperview:5, spacebetween:15, autoplay:4600, loop:true, prevbutton: '.swiper-button-prev', nextbutton: '.swiper-button-next', breakpoints: { 1440: { slidesperview: 4, }, 1034: { slidesperview:3, }, 640: { slidesperview:2, spacebetween:10, }, } }); //关于顺电 var setting = new swiper('.setting ', { slidesperview:4, spacebetween:10, autoplay:4200, loop:true, breakpoints: { 1440: { slidesperview: 4, }, 1034: { slidesperview:3, }, 640: { slidesperview:2, slidespercolumn:2, spacebetween:10, }, } }); //荣誉资质 var honorr = new swiper('.honorr ', { slidesperview:5, spacebetween:25, autoplay:4600, loop:true, breakpoints: { 1440: { slidesperview: 4, }, 1200: { slidesperview:3, }, 1024: { slidesperview:4, }, 768: { slidesperview:3, spacebetween:10, }, 560: { slidesperview:2, spacebetween:10, }, } }); //新闻快讯 var news = new swiper('.newsmain ', { speed: 500, autoheight: true, effect: 'fade', fade: { crossfade: true, }, onslidechangestart: function (swiper) { $(".newsmenu .on").removeclass('on'); $(".newsmenu a").eq(swiper.activeindex).addclass('on'); } }); $(".newsmenu a").on('mouseover', function (e) { $(".newsmenu .on").removeclass('on'); $(this).addclass('on'); news.slideto($(this).index()); }); //新闻列表 var newsswiper = new swiper('.newsslide', { pagination: '.slideicon', effect: 'fade', paginationclickable: true, speed: 800, loop: true, autoplay: 5000, fade: { crossfade: true, }, }); //历史 var historymain = new swiper('.historymain ', { fade: { crossfade: true, }, // autoplay: 4000, onslidechangestart: function () { updatenavposition() } }); var historymenu = new swiper('.historymenu', { slidesperview: 8, ontap: function () { historymain.slideto(historymenu.clickedindex) }, breakpoints: { 1260: { slidesperview: 6 }, 768: { slidesperview: 4 } } }); // $('.historymenu').click(function () { // historymain.startautoplay(); // }); function updatenavposition() { $('.historymenu .on').removeclass('on') var activenav = $('.historymenu .swiper-slide').eq(historymain.activeindex).addclass('on') if (!activenav.hasclass('swiper-slide-visible')) { if (activenav.index() > historymenu.activeindex) { var thumbspernav = math.floor(historymenu.width / activenav.width()) - 1 historymenu.slideto(activenav.index() - thumbspernav) } else { historymenu.slideto(activenav.index()); } } } //荣誉资质 var honor = new swiper('.honorslide ', { slidesperview: 5, spacebetween:60, autoplay: 4800, loop: true, grabcursor: true, prevbutton: '.swiper-button-prev', nextbutton: '.swiper-button-next', breakpoints: { 1440: { slidesperview:5, spacebetween:40, }, 1024: { slidesperview:4, spacebetween:20, }, 640: { slidesperview:3, spacebetween:20, }, 480: { slidesperview:2, spacebetween:20, }, } }); //人才招聘 jquery(".joblist").slide({titcell:".top", targetcell:".font",defaultindex:0,effect:"slidedown",delaytime:300}); //弹出视频 $('.video').on('click', function () { var hre = $(this).find('span').attr('mylink'); layer.open({ type: 2, title: '官方宣传片', shade: 0.8, closebtn: 1, shadeclose: true, skin: 'layer_video', content: hre }); }); }); $(window).resize(function () { responsive(); }); responsive(); function responsive() { var $ww = $(window).width(); if ($ww <= 1024) { $('.wapnav .m').click(function () { $(this).children('.navsub').slidetoggle().end().siblings('.m').children('.navsub').slideup(); $(this).addclass('on').siblings('li').removeclass('on'); }); $('.prosider .title i').click(function(){ $('.proside_sub').stop(true,false).slidetoggle(); }); }else if($ww > 1024){ jquery(".nav").slide({type:"menu", titcell:".m", targetcell:".sub",effect:"fade",delaytime:300, triggertime:0, returndefault:true,defaultplay:false}); $('.proside_sub').show(); } } /* 客服 */ $(document).ready(function () { $(".gr_kefu .kf1").click(function () { $('.gr_kefu .qq').find(".sidebox").stop().animate({ "right": "0" }, 160); $(this).find(".sidebox").stop().animate({ "right": "-50px" }, 160); }); $(".gr_kefu .qq .close").click(function () { $('.gr_kefu .qq').find(".sidebox").stop().animate({ "right": "-150px" }, 160); $('.gr_kefu .kf1').find(".sidebox").stop().animate({ "right": "0" }, 160); }); $(".gr_kefu .kf3").hover(function () { $(this).find(".sidebox").stop().animate({ "width": "130px" }, 160); $(this).find(".sidebox3").stop().animate({ "width": "200px" }, 160); }, function () { $(this).find(".sidebox").stop().animate({ "width": "50px" }, 160); }); $('.gr_kefu .kf2').hover(function () { $(this).find('.kf_wx').fadein(); }, function () { $(this).find('.kf_wx').fadeout(); }); //头部 $(window).scroll(function(){ if($(this).scrolltop()>0){ $(".header").addclass("headfix"); } else{ $(".header").removeclass("headfix"); } }); }); //回到顶部 function gotop() { $('html,body').animate({ 'scrolltop': 0 }, 600); } window.onload = function() { $.ajax({ url: "", }); }