$(document).ready(function(){ //css+js逐步显示 if (!(/msie [6|7|8|9]/i.test(navigator.useragent))) { new wow().init(); }; // //调用例如 class="wow fadeinup animated" //延迟data-wow-delay="0.2s" //导航样式 if(string(window.location).indexof("asp")<0){ //判断是否是首页 $(".nav li:eq(0)").addclass("active");//第一个li获得样式 }; //导航鼠标样式 $(".nav>ul>li").hover(function(){ oneindex=$(this).index(); oneclass=string($(this).attr("class")) if(oneclass.indexof("active")<0){ $(this).addclass("active") } },function(){ if(oneclass.indexof("active")<0){ $(this).removeclass("active") } }) //导航点击后获得样式 daohys=0; win_href=window.location; if(daohys==0){ $(".nav li a").each(function(){ var index=0; onehref=string($(this).attr("href")).replace(".asp","") onehref=onehref.replace("http://",""); onehref=onehref.replace("https://",""); if(string(win_href).indexof(onehref)>0){//获得当前li下a的href值,并进行替换 $(this).closest("li.lisign").addclass("active"); $(this).closest("li.lisign").siblings().removeclass("active"); } }); } //底部友情链接 $(".station_btn").hover(function(){ $(this).find("ul").stop(true,false).slidedown(); },function(){ $(this).find("ul").stop(true,false).slideup(); }) }); /*阻止冒泡事件*/ function stopdefault(e) { if (e && e.preventdefault) {//如果是ff下执行这个 e.preventdefault(); e.stoppropagation(); }else{ window.event.returnvalue = false;//如果是ie下执行这个 } return false; } //滚动到…… function isscrolla(o,r){o=$(o);var t=$(window),r=r||0,e=t.scrolltop(),i=e+t.height(),n=o.offset().top+r,f=n+o.height(),h=n>i;if(h)return!1;var l=f>e;return l?!(h&&l):!1} //获取网站url参数 function geturlparam(name) { var reg = new regexp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 var r = decodeuri(window.location.search).substr(1).match(reg); //匹配目标参数 if (r != null) return unescape(r[2]); return null; //返回参数值 }