;(function($, window, document,undefined) { "use strict"; var Tfn = function() { this.header = $('header'), this.center = $('#wrapper'), this.footer = $('footer'), this.IEnum = null;//如果是ie浏览器,ie的版本数 this.isAnimating = false,//判断轮播动画是否进行中 this.isAnimating1 = false,//判断下拉动画是否进行中 this.aniTime = 600, //动画时间 this.isMobile = false, //区分移动端与PC端 this.mobile = false, //区分手机端与平板 this.windowWidth = ('innerWidth' in window) ? window.innerWidth : document.documentElement.clientWidth, this.windowHeight = ('innerHeight' in window) ? window.innerHeight : document.documentElement.clientHeight, this.rowNode = [],//页面块节点存储 this.appDirection = null;//手机端触摸滑动方向 }; Tfn.prototype = { //初始化 init: function() { var self = this; if (!!window.ActiveXObject || "ActiveXObject" in window){ $('body').addClass("ie"); this.IEnum = parseInt(navigator.appVersion.split(";")[1].replace(/[ ]/g, "").replace("MSIE","")); if(this.IEnum<9){ alert("您的浏览器版本过低,请下载IE9及以上版本");return false; }else if(this.IEnum==9){ $('body').addClass("ie9"); }else if(this.IEnum==10){ $('body').addClass("ie10"); }else if(this.IEnum==11){ $('body').addClass("ie11"); } } // this.storage(); imagesLoaded(document.querySelectorAll('img'), function () { }); self.version(); self.getHash(); self.getScreen(); if(self.isMobile){ this.getSroll();} self.getMenuHover(); self.setInnerBanner(); self.setMessgePop(); self.setPopUp($('.weix'), "微信公众号"); }, // 浏览器版本 version:function(){ var explorer = window.navigator.userAgent ; if (explorer.indexOf("MSIE") >= 0||explorer.indexOf("Trident")>0 ) { if(explorer.indexOf("MSIE 5")>0||explorer.indexOf("MSIE 6")>0||explorer.indexOf("MSIE 7")>0||explorer.indexOf("MSIE 8")>0) { return 'LowerIEVersion'; }else{ return 'EdgeOrTrident'; } } else if (explorer.indexOf("Maxthon") >= 0) {return 'Maxthon';} else if (explorer.indexOf("Firefox") >= 0) {return 'FireFox';} else if(explorer.indexOf("Chrome") >= 0){ return 'Chrome';} else if(explorer.indexOf("Opera") >= 0){ return 'Opera';} else if(explorer.indexOf("Safari") >= 0){ return 'Safari';} }, getSroll: function(){ var hash = location.search.split("&")[1]; console.log('#'+hash) jQuery(".navs-li li a,.operate-navs-li li a").click(function(e){ var hash=jQuery(this).attr("href").split("&")[1]; if(hash && jQuery("&"+hash).length==1){ setScroll("&"+hash); } }); function getHashs(){ if(hash != undefined){ setScroll('#'+hash); } }; var scnum=0; function setScroll(anchorCur){ console.log(anchorCur) scnum=$('.header').outerHeight(); jQuery("html,body").animate({ scrollTop: parseInt(jQuery(anchorCur).offset().top - scnum)},600); }; window.onload = function(){ getHashs(); } getHashs(); }, getScreen: function(){ var self = this; if (this.windowWidth <= 1024) { this.isMobile = true; } else if (this.windowWidth > 1024) { this.isMobile = false; }; //区分手机端和平板 if (this.windowWidth <= 640) { this.mobile = true; } else if (this.windowWidth > 640) { this.mobile = false; }; function initBox() { self.windowWidth = ('innerWidth' in window) ? window.innerWidth : document.documentElement.clientWidth, self.windowHeight = ('innerHeight' in window) ? window.innerHeight : document.documentElement.clientHeight; }; initBox(); jQuery(window).resize(function () { initBox(); }); }, getMenuHover: function() { if(!this.isMobile){ var index_ = $(".navs > li.active").index(); $(".navs > li").hover(function(){ $(this).addClass("active").siblings().removeClass("active"); if($(this).find(".navs-menu").length > 0){ $(this).find(".navs-menu").stop(true, true).slideDown(); $(".header-bg").stop().fadeIn(); } },function () { $(".navs > li").removeClass("active"); if(index_ >=0){ $(".navs > li").eq(index_).addClass("active"); } $(this).find(".navs-menu").stop(true, true).hide(); $(".header-bg").stop().fadeOut(); }) }else{ $(".navs > li > a").bind("click", function (e) { var $navMobile=jQuery(".header-right"), $navA=$navMobile.find(".navs > li > a"), $mSubnav=$navMobile.find(".navs-menu"); var hjDD = $(this).parents("li"); if (hjDD.find(".navs-menu").size() > 0) { if (hjDD.hasClass("now")) { $(".menubtn").removeClass('now'); $(".header-menu").removeClass('show'); hjDD.find(".navs-menu").stop(false, false).slideUp(); hjDD.removeClass("now"); } else { console.log(1) $navA.parents('li').removeClass("now"); $mSubnav.stop(false, false).slideUp(); hjDD.find(".navs-menu").stop(false, false).slideDown(); hjDD.addClass("now"); e.preventDefault(); } } }); } $(".lang").click(function(){ $(".language").stop(true, false).slideToggle(); }); $(".language").mouseleave(function(){ $(".language").stop(true, false).fadeOut(); }); }, setInnerBanner: function() { $(".menubtn").click(function(){ $(this).toggleClass("active"); $(".header-right").toggleClass("show"); }); if($(".pbanner").length> 0){ var s1 = new TimelineMax(); s1.fromTo(".pbanner figure img", 6, {scale: 1.08},{scale: 1}); } if($(".operate-banner").length> 0){ var s1 = new TimelineMax(); s1.fromTo(".operate-banner figure img", 6, {scale: 1.08},{scale: 1}); } }, getHash: function() { }, setMessgePop: function () { $(".contact-btn").click(function(){ $(".poo-message").addClass("show"); }); $(".pop-bgs,.pop-close").click(function(){ $(".poo-message").removeClass("show"); }); }, setPopUp: function(obj, title) { obj.click(function() { var str = '
'; $("body").append(str); jQuery(".popUpblack").fadeIn(); jQuery(".popUp").animate({ marginTop: "-127" }, 400); $(".popUp .close").click(function() { $(".popUpblack").remove(); }); jQuery(".popUpblack").click(function() { $(".popUpblack").remove(); }); return false; }); } } $.fn.myFn = function() { new Tfn().init(); }; })(jQuery, window, document); $(document).myFn(); jQuery(window).load(function() { jQuery('.article-block').delay(500).scrollClass(); }); window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdMiniList": false, "bdPic": "", "bdStyle": "0", "bdSize": "16" }, "share": {} }; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)]; function setImgMax(img, imgW, imgH, tW, tH) { var tWidth = tW || w_width; var tHeight = tH || w_height; var coe = imgH / imgW; var coe2 = tHeight / tWidth; if (coe < coe2) { var imgWidth = tHeight / coe; img.css({ height: tHeight, width: imgWidth, left: -(imgWidth - tWidth) / 2, top: 0 }); } else { var imgHeight = tWidth * coe; img.css({ height: imgHeight, width: tWidth, left: 0, top: -(imgHeight - tHeight) / 2 }); }; };