function getHash(){ var hash = location.href.split("#")[1]; if(hash){ setScroll("#"+hash); } }; var scnum=113; function setScroll(anchorCur){ if(isMobile){ scnum=84; }else{ scnum=113; } jQuery("html,body").delay(300).animate({ scrollTop: jQuery(anchorCur).offset().top-scnum},800,'easeInOutExpo'); }; jQuery(function(){ $('#nav-btn').on('click',function(){ $(this).toggleClass('active'); $('#nav').toggleClass('act').slideToggle(); if (!$('#nav').hasClass('act')) { $('#nav').removeClass("hover"); }else{ $('#nav').addClass("hover"); } }) $('#nav').find('span').on('click',function(){ if ($(this).hasClass('show-div')) { $(this).removeClass().siblings('div').slideUp(); }else{ $('#nav').find('.show-div').removeClass().siblings('div').slideUp(); $(this).addClass('show-div').siblings('div').slideDown(); } }) $('#nav').find('dt').on('click',function(){ if ($(this).hasClass('show-dd')) { $(this).removeClass().siblings('dd').slideUp(); }else{ $('#nav').find('.show-dd').removeClass().siblings('dd').slideUp(); $(this).addClass('show-dd').siblings('dd').slideDown(); } }) $("a.tab").click(function () { $(this).parent().find("a.current").removeClass("current"); $(this).addClass("current"); for(var i=0;i<$(this).parent().find("a").length;i++){ $("#"+$(this).parent().find("a:eq("+i+")").attr("rel")).hide(); } $("#"+$(this).attr("rel")).show(); return false; }); $('.footer-menu dl').each(function(index, el) { $(this).children('dt').click(function(event) { if($(this).hasClass('show')){ $(this).removeClass('show') $(this).siblings('dd').stop().slideUp(); } else { $(this).addClass('show'); $(this).siblings('dd').stop().slideDown(); } }); }); $('.goTop-btn').click(function(){ $('html,body').stop().animate({ scrollTop:0 }, 500,"easeInOutExpo"); }); function topPos(){ ST = $(window).scrollTop(); if( ST<1 ){ $('#goTop').removeClass('show'); }else{ $('#goTop').addClass('show'); } }; topPos(); jQuery(window).scroll(function () { topPos(); }); $(".lazy-img").wapLazyLoad({ effect: "fadeIn", threshold: 80 }); var orientLayer = $("#orientLayer"); //ÅжϺáÆÁÊúÆÁ function checkDirect() { if ($(window).height() >= $(window).width()) { return "portrait"; } else { return "landscape"; } } function orientNotice() { var orient = checkDirect(); if (orient == "portrait") { $("#orientLayer").hide(); } else { $("#orientLayer").show(); } } function initOrient() { orientNotice(); window.addEventListener("onorientationchange" in window ? "orientationchange": "resize", function() { setTimeout(orientNotice, 200); }) } initOrient(); }); //weixin setPopUp($('.show-weixin'), "¹Ù·½Î¢ÐÅ"); function setPopUp(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; }); }; $(document).on('click','.overlayClose',function(){ $('.imgShowBox').removeClass('img-show'); jQuery('html').removeClass('openImg'); setTimeout(function () { jQuery('.imgShowBox').remove(); }, 800); }); function openshowImg(num,imgList) { $('html').addClass('openImg'); jQuery("body").append('
'); for(var i = 0 ; i < imgList.length ; i++){ $('.imgShowDemo').append('
') var imgurl = imgList.eq(i).attr('data-img'); var imgtitle = imgList.eq(i).attr('data-title'); $('.imgShowDemo .item').eq(i).find(".img").attr("src",imgurl); $('.imgShowDemo .item').eq(i).find('.i').html(imgtitle); } $(".imgShowBox").css({ height: win_height }); $('.imgShowDemo').css({ height: win_height }); $('.imgShowDemo .item').css({ height: win_height }); jQuery(window).resize(function(){ $(".imgShowBox").css({ height: win_height }); $('.imgShowDemo').css({ height: win_height }); $('.imgShowDemo .item').css({ height: win_height }); }); var imgowl=jQuery(".imgShowDemo").owlCarousel({ items: 1, slideSpeed : 600, autoPlay: false, navigation: true, pagination: false, singleItem: true, rewindNav: false }); imgowl.data('owlCarousel').jumpTo(num); $('.imgShowBox').addClass('img-show'); } function tabs(outname, outconname, focusclass, displaymethod, speed, sefs, sibling) { if (speed == null) speed = "slow"; if (focusclass == null) focusclass = "tbfocus"; if (displaymethod == null) displaymethod = 0; if (sefs == "") sefs = "click"; if (sibling == "") sibling = "li"; var sw = displaymethod; function myShow(i) { jQuery(outname).eq(i).addClass(focusclass).siblings(sibling).removeClass(focusclass); jQuery(outconname).fadeOut(speed); jQuery(outconname).eq(i).stop(true, true).slideDown(600); } myShow(sw); if (sefs == "click") { jQuery(outname).click(function () { sw = jQuery(outname).index(this); myShow(sw); }); } else if (sefs == "mouseover") { jQuery(outname).mouseover(function () { sw = jQuery(outname).index(this); myShow(sw); }); } };