$(function () { window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)]; //二级导航 $('.header .san').click(function(){ if($(this).hasClass('cur')){ $(this).removeClass('cur'); $('.nav').slideUp(); $('.language').hide(); } else{ $(this).addClass('cur'); $('.nav').slideDown(); setTimeout(function () { $('.language').show(); },300) } }); var _index=$(".page-index").html(); $('.nav li').eq(_index).addClass('cur').siblings().removeClass('cur'); //动画 // $(window).bind('load resize scroll',function(){ // var _whtop=$(window).scrollTop(); // var _pmh=$(window).height(); // $(".animate-tit,.animate-li").each(function(e){ // var _top=$(this).offset().top; // if(_top-_whtop<_pmh*.85){ // $(this).delay(e*100).addClass('on') // } // }) // }); if($(window).width()<1024){ $('.nav li>a').click(function(){ if($(this).siblings("dl").length>0){ $(this).siblings('dl').toggle(); return false; } }) } $(".wechat").click(function () { cancelBubble(); layer.tips($('.code').html(), '.wechat',{ tips: [2, '#ffffff'], time: 500000000, closeBtn: 1 }); }); //得到事件 function getEvent(){ if(window.event) {return window.event;} func=getEvent.caller; while(func!=null){ var arg0=func.arguments[0]; if(arg0){ if((arg0.constructor==Event || arg0.constructor ==MouseEvent || arg0.constructor==KeyboardEvent) ||(typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation)){ return arg0; } } func=func.caller; } return null; } //阻止冒泡 function cancelBubble() { var e=getEvent(); if(window.event){ //e.returnValue=false;//阻止自身行为 e.cancelBubble=true;//阻止冒泡 }else if(e.preventDefault){ //e.preventDefault();//阻止自身行为 e.stopPropagation();//阻止冒泡 } } $(document).click(function () { layer.closeAll('tips'); }); var $body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $('html') : $('body')) : $('html,body'); //operaFix $(".top").click(function(){ $body.animate({scrollTop: 0}); }); });