Site Navigation with jQuery


We started by... Maybe you should View the Source on the Demo. If you have any questions let me know. :/

	$('#topnav li a').click(function(e){
		
		e.preventDefault();
		
		
		if($("html, body").scrollTop() != 0) {
			$("html, body").animate({ scrollTop: 0 }, "slow");
		}		  
		
		var toLoad = $(this).attr('href')+'';
		$('#content').fadeOut(500,loadContent);
		
		$('#load').remove();
		$('#loader').append('LOADING...');
		$('#load').fadeIn('normal');
		
		var hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
		controlAnchoring(hash);
		
		
		setActiveBtn(this);
		function loadContent() {
			$('#content').load(toLoad,'',showNewContent())
		}
		function showNewContent() {
			$('#content').fadeIn(1000,hideLoader());
		}
		function hideLoader() {
			$('#load').fadeOut('normal');
		}
		return false;
		
	});