var windowwith,windowheight; var ismobistaute = false; var browser={ versions:function(){ var u = navigator.useragent, app = navigator.appversion; var suseragent = navigator.useragent; return { trident: u.indexof('trident') > -1, presto: u.indexof('presto') > -1, ischrome: u.indexof("chrome") > -1, issafari: !u.indexof("chrome") > -1 && (/webkit|khtml/).test(u), issafari3: !u.indexof("chrome") > -1 && (/webkit|khtml/).test(u) && u.indexof('webkit/5') != -1, webkit: u.indexof('applewebkit') > -1, gecko: u.indexof('gecko') > -1 && u.indexof('khtml') == -1, mobile: !!u.match(/applewebkit.*mobile.*/), ios: !!u.match(/\(i[^;]+;( u;)? cpu.+mac os x/), android: u.indexof('android') > -1 || u.indexof('linux') > -1, iphone: u.indexof('iphone') > -1, ipad: u.indexof('ipad') > -1, iwinphone: u.indexof('windows phone') > -1 }; }() } if(browser.versions.mobile || browser.versions.iwinphone){ //ismobistaute = true; } $(function(){ getwindowsize(); if(windowwith < 768){ ismobistaute = true; var left = $('.mainnav_tags').find("a.active").index()*70; console.log(left); $(".mainnav_tags").scrollleft(left); $(".item-btn").click(function(){ var left2 = $('.mainnav_tags').find("a.active").index()*85; console.log(left2); $(".mainnav_tags").scrollleft(left2); }) } if(ismobistaute || $(window).width()<992){ //首页 精彩视频 mobile var myswiper = new swiper('.home-video .video-focus .swiper-container',{ loop:true, paginationclickable: true }) $('.home-video .video-focus .swiper-button-prev').on('click', function(e){ e.preventdefault() myswiper.swipeprev(); }) $('.home-video .video-focus .swiper-button-next').on('click', function(e){ e.preventdefault() myswiper.swipenext() }) $('.mainnav_tags span b').click(function(){ $('.mainnav_tags span').toggleclass('up') }) } //首页 精彩视频 $('.tabs2 a').hover(function(){ $('.more2 a').eq($(this).index()).addclass('on').siblings('a').removeclass('on'); }); $('.xxylb-table .xxylb-table-tr th:nth-child(odd)').css({'background':'#f6465a'}); $('.role .gradea td:nth-child(odd)').css({'background':'#e9e9e9'}); $('.role .gradea:nth-child(even)').css({'background':'#e6e6e6'}); $('.role .gradea:nth-child(even)').find('td:nth-child(odd)').css({'background':'#dddddd'}); $('.role .gradea').hover(function(){ $(this).css({'background':'#fc96a2'}); $(this).find('td:nth-child(odd)').css({'background':'#fc96a2'}); },function(){ $(this).css({'background':'#e6e6e6'}) $(this).find('td:nth-child(odd)').css({'background':'#ddd'}); } ) //判断浏览器类型 if ( $(window).width()>992) { var righthight = $('.companyimg img').height(); $('.companyright .right a').css({'height':righthight}) $('.companyright .left a').css({'height':righthight}) }else{ $('.companyright .right a').css({'height':'auto'}) $('.companyright .left a').css({'height':'auto'}) } function isie() { //ie? if (!!window.activexobject || "activexobject" in window) { if ($(window).width()>992) { var homevideoswiper = new swiper('.home-video .video-focus1 .swiper-container',{ centeredslides: true, slidesperview: 2, watchactiveindex: true, loop: true, loopedslides: 3 }) $('.home-video .video-focus1 .swiper-button-prev').on('click', function(e){ e.preventdefault() homevideoswiper.swipeprev(); }) $('.home-video .video-focus1 .swiper-button-next').on('click', function(e){ e.preventdefault() homevideoswiper.swipenext() }) var homevideoswiper2 = new swiper('.home-video .video-focus2 .swiper-container',{ centeredslides: true, slidesperview: 1, watchactiveindex: true, loop: true }) $('.home-video .video-focus2 .swiper-button-prev').on('click', function(e){ e.preventdefault() homevideoswiper2.swipeprev(); }) $('.home-video .video-focus2 .swiper-button-next').on('click', function(e){ e.preventdefault() homevideoswiper2.swipenext() }) } } else{ if ($(window).width()>992) { var homevideoswiper = new swiper('.home-video .video-focus1 .swiper-container',{ centeredslides: true, slidesperview: 2, watchactiveindex: true, loop: true, loopedslides: 3, tdflow: { rotate : 30, stretch :10, depth: 150 } }) $('.home-video .video-focus1 .swiper-button-prev').on('click', function(e){ e.preventdefault() homevideoswiper.swipeprev(); }) $('.home-video .video-focus1 .swiper-button-next').on('click', function(e){ e.preventdefault() homevideoswiper.swipenext() }) } } } isie(); }) function getwindowsize(){ windowwith = $(window).width(); windowheight = $(window).height(); } var tabs = function(tab, con){ tab.click(function(){ var indx = tab.index(this); tab.removeclass('current'); $(this).addclass('current'); con.hide(); con.eq(indx).show(); }) } jquery(".scroll-1").slide({ titcell: ".hd-1 ul", maincell: ".bd-1 ul", autopage: true, effect: "leftloop", autoplay: true, vis: 1, trigger: "click", intertime: 3000 }); jquery(".zt-scroll").slide({ maincell: ".zt-bd ul", autopage: true, effect: "leftloop", autoplay: false, vis: 5, trigger: "click" }); jquery(".scroll-2").slide({ titcell: ".hd-2 ul", maincell: ".bd-2 ul", autopage: true, effect: "toploop", autoplay: true, vis: 1, trigger: "click" }); jquery(".scroll-3").slide({ titcell: ".hd-3 ul", maincell: ".bd-3 ul", autopage: true, effect: "leftloop", autoplay: true, vis: 1, trigger: "click" });