var tme={}; tme.init=function(){ tme.event(); } // 配置事件 tme.event=function(){ // var browser = (function(){ // var ua = window.navigator.useragent.tolowercase(), sys = null, s; // if(s = ua.match(/rv:([\d.]+)\) like gecko/)){sys = {type:'ie',version:s[1]};} // else if(s = ua.match(/msie ([\d.]+)/)){sys = {type:'ie',version:s[1]};} // else if(s = ua.match(/firefox\/([\d.]+)/)){sys = {type:'firefox',version:s[1]};} // else if(s = ua.match(/chrome\/([\d.]+)/)){sys = {type:'chrome',version:s[1]};} // else if(s = ua.match(/opera.([\d.]+)/)){sys = {type:'opera',version:s[1]};} // else if(s = ua.match(/version\/([\d.]+).*safari/)){sys = {type:'safari',version:s[1]};} // else if(s = ua.match(/ucbrowser\/([\d.]+)/)){sys = {type:'uc',version:s[1]};} // else if(s = ua.match(/micromessenger\/([\d.]+)/)){sys = {type:'wx',version:s[1]};} // else{sys = {type:'unknown',version:'unknown'};} // sys.ismobile = !!ua.match(/applewebkit.*mobile.*!/) || !!ua.match(/(iphone|ipod|android|ios|ipad)/i); // return sys; // })(); /*检测ie*/ // if(browser.type =="ie" && browser.version < 9){ // location.href="http://outdatedbrowser.com/zh-cn"; // } /*判断谷歌27*/ // if(browser.type == 'chrome' && browser.version <= 27){ // $('.font_scale8, .font_scale10').addclass('font_adjust'); // } tme.fnbacktop(); tme.fnsmallnav(); tme.fnpop(); tme.fnowlcarousel(); tme.fnmenue(); tme.fnaboutcarousel(); tme.fnsolutioncarousel(); tme.fnsmallmenue(); tme.fnhonor(); } tme.fnsmallnav=function(){ $(".nav_btn,.mask_bg").click(function(){ $(".nav_btn").toggleclass("on"); $(".nav").toggleclass("on"); $(".mask_bg").delay(500).fadetoggle(); }) } tme.fnpop=function(){ $('.cd-popup-trigger0').on('click', function(event){ event.preventdefault(); $('.cd-popup').addclass('is-visible'); //$(".dialog-addquxiao").hide() }); //关闭窗口 $('.cd-popup').on('click', function(event){ if( $(event.target).is('.cd-popup-close') || $(event.target).is('.cd-popup') ) { event.preventdefault(); $(this).removeclass('is-visible'); } }); //esc关闭 $(document).keyup(function(event){ if(event.which=='27'){ $('.cd-popup').removeclass('is-visible'); } }); } tme.fnowlcarousel=function(){ $('.js_business .owl-carousel').owlcarousel({ loop: true, margin: 10, responsiveclass: true, responsive: { 0: { items: 1, nav: true }, 420: { items: 2, nav: true, margin: 30 }, 992: { items: 3, nav: true, loop: true, margin: 45 } } }) } // } //返回顶部 tme.fnbacktop=function(){ $(window).scroll(function(){ var scrollheight=$(this).scrolltop(); if(scrollheight>10){ $(".back_topbtn").addclass("back_topbtnshow"); }else{ $(".back_topbtnshow").removeclass("back_topbtnshow"); } }) $(".back_topbtn").on("click",function(){ $('html,body').animate({scrolltop:0},300); }) } /*小屏二级导航下拉*/ tme.fnsmallmenue=function(){ $('.menue .title').click(function(){ $(this).toggleclass('hopen'); $('.menue ul').toggleclass('ulopen'); }) } /*关于我们页面*/ tme.fnaboutcarousel=function(){ $('.js_aboutpic .owl-carousel').owlcarousel({ loop: true, margin: 10, responsiveclass: true, responsive: { 0: { items: 1, nav: true }, 420: { items: 2, nav: true, margin: 30 }, 992: { items: 3, nav: true, loop: false, margin: 30 } } }) } tme.fnsolutioncarousel=function(){ $('.js_solution .owl-carousel').owlcarousel({ loop: true, margin: 10, responsiveclass: true, responsive: { 0: { items: 1, nav: true }, 420: { items: 2, nav: true, margin: 30 }, 768: { items: 3, nav: true, margin: 30 }, 1200: { items: 4, nav: true, loop: false, margin: 13 } } }) } tme.fnhonor=function(){ $('.js_honor .owl-carousel').owlcarousel({ loop: true, margin: 10, responsiveclass: true, responsive: { 0: { items: 1, nav: true }, 420: { items: 3, nav: true, margin: 20 }, 992: { items: 4, nav: true, loop: false, margin: 40 } } }) } //内页二级导航 tme.fnmenue=function(){ var w=$(".menue ul li.on a").outerwidth(); var l=$(".menue ul li.on a").position().left; $(".menue .line").css({"width":w,"left":l}) $(".menue ul li a").hover(function(){ var w=$(this).outerwidth(); var l=$(this).position().left; $(".menue .line").stop().animate({"width":w,"left":l},{duration:500,easing:"swing"}); },function(){ $(".menue .line").stop().animate({"width":w,"left":l},{duration:500,easing:"swing"}); }) } $(document).ready( tme.init );