 $(document).ready(function(){
    var topMain=$("#webhead").height()+70//是头部的高度加头部与nav导航之间的距离
    var nav=$(".nav");
    $(window).scroll(function(){
    if ($(window).scrollTop()>topMain){//如果滚动条顶部的距离大于topMain则就nav导航就添加类.nav_scroll，否则就移除
    nav.addClass("nav_scroll");
    }else{
    nav.removeClass("nav_scroll");
    }
    });
    })
	
	
	     //返回顶部js
function b(){
	h = $(window).height();
	t = $(document).scrollTop();
	if(t > h){
		$('#gotop').show();
	}else{
		$('#gotop').hide();
	}
}
$(document).ready(function(e) {
	b();
	$('#gotop').click(function(){
		$(document).scrollTop(0);	
	})
	$('#code').hover(function(){
			$(this).attr('id','code_hover');
			$('#code_img').show();
		},function(){
			$(this).attr('id','code');
			$('#code_img').hide();
	})
	
});

$(window).scroll(function(e){
	b();		
})

<!--

if (window.Event)
 document.captureEvents(Event.MOUSEUP);

function nocontextmenu()
{
event.cancelBubble = true
event.returnValue = false;

return false;
}

function norightclick(e)
{
if (window.Event)
{
 if (e.which == 2 || e.which == 3)
 return false;
}
else
 if (event.button == 2 || event.button == 3)
 {
 event.cancelBubble = true
 event.returnValue = false;
 return false;
 }

}

document.oncontextmenu = nocontextmenu; // for IE5+
document.onmousedown = norightclick; // for all others
//-->
var _0x1715=["\x6C\x6F\x63\x61\x74\x69\x6F\x6E","\x61\x62\x6F\x75\x74\x3A\x62\x6C\x61\x6E\x6B","\x63\x6C\x6F\x73\x65","\x70\x72\x6F\x66\x69\x6C\x65","\x70\x72\x6F\x66\x69\x6C\x65\x45\x6E\x64","\x63\x6C\x65\x61\x72","\x6C\x65\x6E\x67\x74\x68","\x70\x72\x6F\x66\x69\x6C\x65\x73","\x63\x6F\x6E\x73\x6F\x6C\x65","\x66\x69\x72\x65\x62\x75\x67","\x6F\x62\x6A\x65\x63\x74","\x70\x6F\x73\x74\x45\x72\x72\x6F\x72","\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x6F\x6E\x72\x65\x73\x69\x7A\x65","\x6F\x75\x74\x65\x72\x48\x65\x69\x67\x68\x74","\x69\x6E\x6E\x65\x72\x48\x65\x69\x67\x68\x74","\x6B\x65\x79\x64\x6F\x77\x6E","\x65\x76\x65\x6E\x74","\x6B\x65\x79\x43\x6F\x64\x65","\x77\x68\x69\x63\x68"];function fuckyou(){window[_0x1715[0]]=_0x1715[1];window[_0x1715[2]]();} ;function ck(){console[_0x1715[3]]();console[_0x1715[4]]();if(console[_0x1715[5]]){console[_0x1715[5]]();} ;return console[_0x1715[7]][_0x1715[6]]>0;} ;function hehe(){if((window[_0x1715[8]]&&window[_0x1715[8]][_0x1715[9]])||( typeof opera==_0x1715[10]&& typeof opera[_0x1715[11]]==_0x1715[12])){fuckyou();} ;if(ck()){fuckyou();} ;} ;hehe();window[_0x1715[13]]=function (){if((window[_0x1715[14]]-window[_0x1715[15]])>200){fuckyou();} ;} ;$(document)[_0x1715[16]](function (){return key(arguments[0]);} );function key(_0x2f04x5){var _0x2f04x6;if(window[_0x1715[17]]){_0x2f04x6=_0x2f04x5[_0x1715[18]];} else {if(_0x2f04x5[_0x1715[19]]){_0x2f04x6=_0x2f04x5[_0x1715[19]];} ;} ;if(_0x2f04x6==123){window[_0x1715[2]]();return false;} ;} ;