//娓呴櫎鍒楄〃椤垫爣棰樹笅闈㈡憳瑕佺殑绌烘牸 window.onload = function(){ var tg = "g"; var len = $('.article-con').length; function Trim(str,is_global){ var result; result = str.replace(/(^\s+)|(\s+$)/g,""); if(is_global.toLowerCase()=="g") { result = result.replace(/\s/g,""); } return result; } for(var i = 0; i <= len ; i++){ var str = $('.article-con').eq(i).text(); var con = Trim(str,tg); $('.article-con').eq(i).text(con); } $('.article-con').css('text-indent','2em'); } function showlayer(e,fun,type){ if(!fun){fun=function(){};} if($(e).find(".sbar").length>0){ $(e).find(".sbar").mCustomScrollbar(); } $(e).addClass("showdiv"); fun(); } function hidelayer(e,fun,type){ if(!fun){fun=function(){};} $(e).removeClass("showdiv"); if(typeof(player)!="undefined"){player.pause();} fun(); if($(e).find(".playing").length>0){ var v=$(e).find(".playing")[0]; v.pause(); $(e).find(".playing").removeClass("playing"); } } $(document).ready(function(){ //鎼滅储 $("form[name='amj-form']").on("submit",function(e){console.log('123'); e.preventDefault(); var sr = $("input[name='sr']").val(); var pageId = $("input[name='pageId']").val(); var pNo = $("input[name='pNo']").val(); var q = $("input[name='q']").val(); if(q.indexOf(" ") >= 0 || q.length == 0 || q == null){ alert("鎼滅储鍐呭涓嶈兘涓虹┖") }else{ window.open('/search/pcRender?sr='+sr+'&pageId='+pageId+'&pNo='+pNo+'&q='+q); } }) $(".search_mobile").click(function(){ showlayer("#search"); setTimeout(function(){ $(".search_box .kw").focus(); },100); }); $('.header .menu').on('click',function(){ var yheight = window.pageYOffset; var headerHeight = $('.header').height()*2; var height = $('.banner').height()-headerHeight; if(yheight < height){ $('.header').toggleClass('header_state'); $('.oz1').toggleClass('op'); $('.oz2').toggleClass('op'); } $(this).toggleClass('menu_state'); $('.nav_mobile').toggleClass('nav_mobile_state'); }) // 璇︾粏椤垫坊鍔犲乏渚у鑸 if ($(".xxBox").length>0) { //var pageName_dw = $(".dw").children(":last-child").text(); var pageName_dw = $(".dw a").eq($(".dw a").length-1).text(); var pageName_tit = $(".dw a").eq($(".dw a").length-2).text(); var pageName_nav = ""; var suzhu1 = []; var suzhu2 = []; var nav_str = "

"+ pageName_tit +"

"); if($(".leftNav ul li").length == 0){ $(".leftNav h1").text(pageName_dw); $(".leftNav h1").addClass("hNO"); } } //宸︿晶瀵艰埅鍔ㄦ晥 if($(".listbox").length>0){ if($(".leftNav li").length==0){$(".leftNav span").hide();} var leftNav_top = $(".leftNav .state").position().top; $(".cc").css('top',leftNav_top+'px'); $(".leftNav ul").on('mouseover','li',function(){ $(".cc").css('transition', 'all .3s ease-out'); leftNav_top = $(this).position().top; $(".cc").css('top',leftNav_top+'px'); }) $(".leftNav ul").mouseleave(function(){ leftNav_top = $(".leftNav .state").position().top; $(".cc").css('top',leftNav_top+'px'); }) } }) var tme = {}; tme.init = function(){ tme.swiperXW(); tme.swiperTab(); } tme.swiperXW=function(){ var swiper1 = new Swiper('#swiperXW', { speed:1000, loop:true, autoplay: { delay: 4000, stopOnLastSlide: false, disableOnInteraction: false, }, pagination: { el: '#swiperXW .swiper-pagination', clickable :true, }, }) } tme.swiperTab=function(){ var swiperTab = new Swiper('.swiper-containerTab', { spaceBetween: 30, effect : 'fade', fadeEffect: { crossFade: true, }, on: { slideChangeTransitionStart: function() { $(".tabindexListTab span").removeClass("tab").eq(this.activeIndex).addClass("tab"); //$(".tabindexListXw_more").attr('href',$('.swiper-containerQx .link_more').eq(this.activeIndex).attr('href')); } } }); $(".tabindexListTab span").mouseenter(function() { var index = $(this).index(); $(".tabindexListTab span").removeClass("tab").eq(index).addClass("tab"); swiperTab.slideTo(index, 300, false); //$(".tabindexListXw_more").attr('href',$('.swiper-containerQx .link_more').eq(index).attr('href')); }) } $(document).ready( tme.init );