/*! Project : 寰疯タ浜氬疄涓氭湁闄愬叕鍙 +---------common.js----------+ | | | Author | yeshiqiu | | Q__Q | 337676937 | | Addr | SC_Chengdu | | Date | 2020.04.10 | | | +--!-_-!--------------!-_-!--+ */ $b=$("body"); w.Y_LazyLoad(); // 椤堕儴鍒囨崲Class ;(function($){ var setNav = function(dur){ // if($(".mc-Main").length) {return;} var bFlag=w.scrollTop()>($(".TopLine").length?$(".TopLine").offset().top:1); // if($(".subpage").length){bFlag=!0;} if(dur!=undefined){$(".header").Y_SetCss3({dur:"0ms"}); setTimeout(function(){$(".header").removeAttr('style'); },1); } bFlag?$(ysq.wrap).addClass('fixedNav'):$(ysq.wrap).removeClass('fixedNav'); }; w.on("scroll.navC",function(){setNav();}); setNav(0); })(jQuery); // setSubPage ;(function($){ setMinHeight($(".subpage")); setMinHeight($(".index")); function setMinHeight($e) { if(!$e.length)return; var $TL=$(".TopLine"),$BL=$(".BottomLine"); $e.css("min-height",function(){return $(this).css("min-height")||0;}); if($(ysq.wrap).outerHeight()Global.resWidth) { Global.device = "pc"; // 棣栧睆banner // if(920/1920*w.width()>w.height()-$(".header").outerHeight()){ // $(".banner").css({paddingBottom:(w.height()-$(".header").outerHeight())/w.width()*100+"%"}); // } //bg set // $(".suitableBg").length && fullsetImg($(".suitableBg"), 1920, Global.DesignHeight); } else { Global.device = "wap"; } //bg set setTimeout(function() { // ysq.FzAuto(); // $(".suitableBg").each(function(i, oE) { // $(oE).css({height: "100%", width: "auto"}); // if($(oE).width()<=w.width()){ // $(oE).css({width: "100%", height: "auto", top: "50%", marginTop:-$(oE).height()/2,left:0,marginLeft:0 }); // }else{ // $(oE).css({left: "50%", marginLeft:-$(oE).width()/2,top:0,marginTop:0 }); // } // }); // $(".resImg").each(function(i,oE) { $(oE).attr("src",function(e,a){ var _src=''; $.each($(oE).attr("data-src").split("|"),function(i,data) { data=data.split(","); if(w.width()<=data[0]){_src=data[1]; } }); return _src; }); }); }, 1); // var _device=Global.device; // if(!MinWidth(750)){_device="mini";} // $(".sec_bg img").each(function(i,e) { // $(e).attr({"src":$(e).attr(Global.device+"-src")}) // }); // $(".res-img").css({paddingBottom:$(".sban").attr(_device+"-pad")}); if (w.data("device_status") != Global.device) { if (Global.device == "pc") { $h.addClass(Global.device).removeClass('wap'); $(".header").removeClass('navshow').find(".subnav").hide(); } else if (Global.device == "wap") { $h.addClass(Global.device).removeClass('pc'); } w.data("device_status", Global.device); } this.resizeTimer = setTimeout(function(){ w.trigger('scroll'); },100); }).trigger('resize.baset'); // 瀵艰埅 ;(function($) { var baseY=0; w.on("scroll.fixNav",function(eve) { if(w.scrollTop()>=1/*$(".TopLine").offset().top-$(".header").height()*/){$(ysq.wrap).addClass('fixNav');} else {$(ysq.wrap).removeClass('fixNav');} }); var $navBg=$(".header .bg"),$firNav = $(".header .firNav"),$secNav = $(".header .secNav"); $(".navbtn").click(function(e) { var $this=$(this), $initItem=$firNav.find('.secNav .secItem.on'); // fnScrollElePd($(".header"))&&$.fn.Y_ScrollEle.Init($(".header"))&&$.fn.Y_ScrollEle.Do($(".header"),0,!0); if($b.hasClass('navShow')){ $b.removeClass('navShow'); // $navBg.fadeOut(); // $firNav.css({right: "-100%"}); }else{ $b.addClass('navShow'); // $navBg.fadeIn(); // $initItem.length&&$initItem.parents(".secNav").show(); // $firNav.css({"right": "0%"}); } }); $navBg.click(function(event) { $b.removeClass('navShow'); // $navBg.fadeOut(); // $firNav.css({right: "-100%"}); }); // w.on("resize.nav",function(event) { $firNav.find('.firItem').off("mouseleave.nav").off("mouseenter.nav").off("click.nav"); if(Global.device == "pc"){ // reset-Pc $(".navbtn").removeClass('navShow'); $navBg.fadeOut(); $firNav.add($secNav).removeAttr('style'); // $firNav.find('.firItem').on("mouseenter.nav",function(eve) { $(this).siblings().find('.secNav').slideUp().removeClass("active"); $(this).find('.secNav').stop(!0,!0).slideDown().addClass("active"); }).on("mouseleave.nav",function(event) { $(this).find('.secNav').stop(!0,!1).slideUp().removeClass("active"); }); }else{ $firNav.find('.firItem').on("click.nav",function(eve) { var $this=$(this); if($this.find('.secNav').length){ if($this.find('.secNav').is(':hidden')){ $this.siblings(".firItem").removeClass("on").find('.secNav').hide(0); $this.addClass("on").find('.secNav').show(0); return prevent_default(eve); } } }); } }).trigger('resize.nav'); })(jQuery); (function () { var $sForm=$(".searchBox"); var $trigger=$(".searchTrigger"); $sForm.delegate(".enter","click",function(event){ if($sForm.hasClass("show")){ var $ipt=$('.skin',$sForm); $ipt.removeClass("red"); if(isNull($ipt.val())){ return $ipt.focus().parent().addClass("red"), // $ipt.Y_Animation({animation:"false"}), prevent_default(event); } }else{ } }).on("mouseenter",function(event){ clearTimeout($sForm[0].Y_Timer); searchOpen(); }).on('mouseleave', function(event) { $sForm[0].Y_Timer=setTimeout(function(){ searchClose(); },200); }); function searchClose(){ // unlockScroll(); $trigger.removeClass('active'); $sForm.removeClass('show'); $('.skin',$sForm).blur().parent().removeClass("red"); } function searchOpen(){ // lockScroll(); $trigger.addClass('active'); $sForm.addClass('show'); $('.skin',$sForm).focus(); } $b.delegate(".searchTrigger","click",function(event){ if($(this).hasClass('active')){ searchClose(); }else{ searchOpen(); } return prevent_default(event); }); $sForm.delegate(".close","click",function(event){ searchClose(); if(!$(this).parents("#modal-SearchBox").length){ window.history.go(-1); } }); })(); w.on("scroll.numCountUp",function(event) { if(ysq.shutDown)return; $(".numCountUp").each(function(i,oE) { if(inWindow($(oE))&&!$(oE).hasClass("bindedFn")){ $(".num",oE).each(function(ii,oNum) { var numStart = new CountUp(oNum, $(oNum).attr("data-startVal")||0, $(oNum).attr("data-endVal"), $(oNum).attr("data-decimals")||0, 2); setTimeout(function(){numStart.start(); },100*ii+(parseInt($(oE).attr("data-delay"))||150) ); }); $(oE).addClass('bindedFn'); } }); }).trigger("scroll.numCountUp"); $('.index-about-switch').Y_Move({transparent:!0,IsDrag:!1,IsPaging:!0,setPaging:!0,TimeOut:3}); $('.index-dexiya-why-tab').Y_Tab({btnAnimate:!0,clickMoveTg:[!0,"h","scroll"],event:Global.device == "pc"?"mouseenter":"click"}); $('.index-news-switch').Y_Move({transparent:!0,IsDrag:!1,IsPaging:!0,setPaging:!0}); $('.index-news-marquee').Y_Marquee({contain:".ysqJsBox",vertical:!0,oneByone:!1,rate:1}); $('.index-partner-marquee').Y_Marquee({contain:".ysqJsBox",vertical:!1,oneByone:!1,rate:2}); $('.footer-tab').Y_Tab({event:Global.device == "pc"?"mouseenter":"click" ,fn:{ after:function($this,$TtC,$TgC){ if(Global.device == 'pc'){ $this.mouseleave(function(event) { $TtC.removeClass("on"); $TgC.removeClass("on"); }); } $TtC.removeClass("on"); $TgC.removeClass("on"); } }}); /*$backToTop*/ (function($){ $(".backToTop").length||!0&&$(ysq.wrap).append('
'); var $backToTop=$(".backToTop"),bSync=!1, botSet=function(){var nFot=$(".BottomLine").length?$(".BottomLine").offset().top:0,nErr=$h.height()-nFot; var pd=$h.height()-w.height()-nErr;$backToTop.css({bottom:(w.scrollTop()>pd)?(w.scrollTop()-pd):0});}; bSync&&w.resize(botSet).on("scroll.BackTop",function(){botSet(); w.scrollTop()>w.height()?$backToTop.addClass("active"):$backToTop.removeClass("active");}).trigger('scroll.BackTop'); $backToTop.click(function(){Y_BodyScroll({goal:0,err:0,dur:600});}); $backToTop.attr("scrollEle","rotateInY"); })(jQuery); $('.sAbout-honor-slide').Y_ResMove({sData:[{w:1600,mr:.02,n:4},{w:1440,mr:.03,n:3},{w:1024,mr:.02,n:4},{w:768,mr:.04,n:3}],lazyLoad:[!0,100],IsDrag:!0,IsPaging:!0,setPaging:!0,TimeOut:3}); ;(function($){ function scrollBox_init($oE){ var $this = $oE; if ($this.hasClass('disable')) {return !0; } var axis = $this.hasClass('x') ? "x" : "y"; var flag = axis=="x" ? ($(".overview", $this).children().width() > $(".viewport", $this).width()) : ($(".overview", $this).height() > $(".viewport", $this).height()); if (flag) { $(".overview", $this).addClass("mousein"); $this[0].unbindable||$this.tinyscrollbar({ // thumbSize: 60, wheelLock:!0, axis: axis, wheelSpeed:40, wheel: true });$this[0].unbindable=!0; $this.data("MsFlag", !0).find(".scrollbar").stop(!0,!1).fadeIn(); } else { $this.find('.scrollbar').hide(); } $this.data("MsFlag") && $this.data("plugin_tinyscrollbar").update("relative"); } $b.delegate(".module-Scrollbox", 'mouseenter.scrollbox', function() { scrollBox_init($(this)); }).delegate(".module-Scrollbox", 'mouseleave.scrollbox', function() { var $this = $(this); if ($this.hasClass('disable')) {return !0; } $(".overview", $this).removeClass("mousein"); // $(".scrollbar",$this).delay(200).stop(!0,!1).fadeOut(); }); $('.module-Scrollbox').each(function(i,oE) {scrollBox_init($(oE)); }); w.on("resize.scrollbox",function(event) { // $('.module-Scrollbox .scrollbar').hide(); MinWidth(1024)?$(".module-Scrollbox").removeClass("unlock"):$(".module-Scrollbox").addClass("unlock"); }).trigger('resize.scrollbox'); })(jQuery); if($(".trigger-album").length){ $b.append('
' + 'X' + '
' + '
' + '
' + '鏌ョ湅鍘熷浘' + '
1/1
' + '
' + '' + '' + '
'); setTimeout(function(){ $(".trigger-album").find('.item').addClass('btn'); $("#albumWindow").Y_ModalAlbum({ triggerList:".trigger-album",item:".item",btn:'.btn',pad:[0,0,0,0],IsDrag:!0,HasTitle:!0,synchro:!0,serialNum:!0,fn:{ created:function($this,$Tt,$Tg){ // $Tt.find('.img span').append('

'+$Tg.find('h3').text()+'

') // $Tt.find('.img span').append('
鐐瑰嚮涓嬭浇姝ゅ浘
') } }}); },200); } $('.sProduct-columns-tab').Y_Tab({clickMoveTg:[!0,"o","scroll"]}); $('.sProduct-switch').Y_Move({transparent:!0,IsDrag:!0,IsPaging:!0,setPaging:!0,TimeOut:3}); $('.sCase-messageBoard-marquee').Y_Marquee({contain:".ysqJsBox",vertical:!0,oneByone:!1,rate:1}); // subNav ;(function($){ $('.sProduct-navs .dd').each(function(i,oE) { var $this=$(oE),X=0.5, //0.5灞呬腑 0灞呭乏 $viewport=$(oE), $overview=$(".overview",oE), $itemOn=$('.link.on',oE); if($itemOn.length&&$overview.outerWidth()>$viewport.outerWidth()){ $viewport.scrollLeft($itemOn.offset().left+$viewport.scrollLeft()-($viewport.offset().left)+($itemOn.outerWidth()-$viewport.outerWidth())*X); } }); })(jQuery); jQuery(document).ready(function($) { $('#qrcodeBtn').click(function(event) { var $this=$(this); if(Global.device == "wap"){ var _img = $this.siblings('.come').find('.qrcode').html(); Y_Tan(_img,{bAutoClose:!1,cls:"modal-qrcode"}); } }); });