fontSize(); $(window).resize(function () { fontSize(); }); /* 璋冩暣html瀛椾綋澶у皬 */ function fontSize() { var size; var winW = window.innerWidth; if (winW <= 1680 && winW > 800) { size = Math.round(winW / 18); } else if (winW <= 800) { size = Math.round(winW / 7.5); if (size > 65) { size = 65; } } else { size = 100; } $('html').css({ 'font-size': size + 'px' }) } //瀵艰埅閫変腑鐘舵€ $(".header .nav li a").each(function(){ var url = $($(this))[0].href if (String(window.location).indexOf(url) != -1 && url!="/"){ $(this).addClass('hover'); $(".header .nav li:nth-child(1) a").removeClass('hover'); } }); //鍒嗕韩鍒板井鍗 function weiboShare(type){ var weiboUrl = "https://service.weibo.com/share/share.php?url="+window.location.href+"&title="+$(document).attr("title"); window.open(weiboUrl); } //鍒嗕韩鍒癚Q function qqShare(type){ var weiboUrl = "https://connect.qq.com/widget/shareqq/index.html?url="+window.location.href+"&showcount=0&desc="+$('meta[name="description"]').attr('content');+"&title="+$(document).attr("title"); window.open(weiboUrl); } //鍒嗕韩鍒板井淇″脊绐 function shareWx(){ //椤甸潰灞 layer.open({ title:"鍒嗕韩鎻愮ず", type: 1, skin: 'layui-layer-rim', //鍔犱笂杈规 area: ['250px', '250px'], //瀹介珮 content: '

寰俊鎵竴鎵紝鍗冲彲鍒嗕韩鍐呭缁橳A

' }); jQuery('#qrcode').qrcode({width: 130,height: 130, text:window.location.href}); } //澶撮儴鎼滅储 $(".header .btnSearch").click(function(event){ $(".header .searchBox").stop().slideToggle(); event.stopPropagation(); }); $(".header .searchBox input,.header .searchBox .btnSearch1").click(function(event){ event.stopPropagation(); }) //閫夋嫨璇 $(".header .btnLanguage").hover(function(){ $(".header .languageBox").stop().slideDown(); },function(){ $(".header .languageBox").stop().slideUp(); }); //閫夋嫨鍟嗗煄 $(".header .btnMall").hover(function(){ $(".header .mallBox").stop().slideDown(); },function(){ $(".header .mallBox").stop().slideUp(); }); //澶撮儴浜岀淮鐮 $(".header .right .wechat").hover(function(){ 聽 $(this).find(".ewm").stop().fadeIn(); },function(){ 聽 $(this).find(".ewm").stop().fadeOut(); }) //搴曢儴闆嗗洟灞曞紑 $(".footer .bottom .right .other").hover(function(){ $(this).find(".otherList").stop().slideDown(); },function(){ $(this).find(".otherList").stop().slideUp(); }) //浜у搧浜岀骇瀵艰埅 $(".header .nav li").hover(function(){ $(this).find("a").addClass("active"); $(this).find(".navBox").stop().slideDown(); },function(){ $(this).find("a").removeClass("active"); $(this).find(".navBox").stop().slideUp(); }); /* 涓嬫媺閫夋嫨妗 */ function select(dom, callback) { $(dom).find('.select-con').text($(dom + ' .option li').eq(0).text()) $(dom + '.option li').eq(0).addClass('active'); $(dom).click(function (event) { $('.select').children('.option').hide(); event.stopPropagation(); $(this).children('.option').show(); $(this).find('.select-icon').css('transform','rotate(180deg)'); }) $(dom + ' .option li').click(function (event) { event.stopPropagation(); $(dom + ' .option li').removeClass('active'); $(dom).find('.select-con').text($(this).text()) $(dom + ' .option').hide(1); $(this).addClass('active'); $(dom).find('.select-icon').css('transform','rotate(0deg)'); callback && callback($(this).text(),$(this).index()); }) $('body').click(function(){ $(dom + ' .option').hide(1); $(dom).find('.select-icon').css('transform','rotate(0deg)'); }) } //瑙嗛寮圭獥 var videoList = ""; function videoBoxPop(title,poster,link,contentId,downloadUrl){ var bw=document.documentElement.clientWidth; var bh=document.documentElement.clientHeight; var html = '
'+ '

'+title+'

'+ '
'+ '
'+ ''+ ''+ '
'+ '
'+ '
'+ '
'+ '
'; $("body").append(html); $(".video-popup").show(); var videoListObject = { container:'#videoPlayPop', variable:'player', autoplay:true, poster:poster, video:link }; videoList=new ckplayer(videoListObject); } //鍏抽棴瑙嗛寮圭獥 function closeVideoPopup(){ $(".video-popup").remove(); } //鎻愮ず淇℃伅 鍚搁檮杈撳叆妗 function errorTip(msg,element){ layer.tips(msg,element, { tips: [1, '#004ABB'], time: 2500 }); } //鎻愮ず淇℃伅 寮圭獥 function errorMsg(msg){ layer.alert(msg,{ title:"鎻愮ず" }) } //琛ㄥ崟鎻愪氦鎴愬姛 function orderSuccess(content){ layer.msg(content, {time: 2500, icon:6}); } //琛ㄥ崟鎻愪氦澶辫触 function orderFail(content){ layer.msg(content, {time: 2500, icon:5}); } //婊氬姩鍒ゆ柇 var beforeScrollTop = 0; if(window.addEventListener) // Firefox 1+, Opera 9, Safari 3+, etc. { beforeScrollTop = window.pageYOffset; window.addEventListener("scroll", scrollFun, false); } else if(document.addEventListener) // Opera 7, Opera 8 { beforeScrollTop = window.pageYOffset; document.addEventListener("scroll", scrollFun, false); } else if("onscroll" in self) // MSIE 6, 7 and MSIE 8 { self.onscroll = scrollIE; }; function scrollIE(){ var afterScrollTop = document.documentElement.scrollTop; //杩斿洖椤堕儴 if(afterScrollTop > 500){ $(".fright .last").show(); }else{ $(".fright .last").hide(); } } function scrollFun(){ var afterScrollTop = 0; if(window.addEventListener){ afterScrollTop = window.pageYOffset; } else if(document.addEventListener){ afterScrollTop = window.pageYOffset; } else if(document.all && document.compatMode && document.compatMode == "CSS1Compat"){ afterScrollTop = document.documentElement.scrollTop } updown = afterScrollTop - beforeScrollTop; headerH = $(".header").outerHeight(); if( updown === 0 ) return false; beforeScrollTop = afterScrollTop; //杩斿洖椤堕儴 if(afterScrollTop > 500){ $(".fright .last").show(); }else{ $(".fright .last").hide(); } } //杩斿洖椤堕儴 $(".g-top").click(function(){ $('html,body').animate({scrollTop: 0},'slow'); });