Learn how to use jQuery at the Blog

Southern Media « visit

  • Added 8 months ago
  • 203 Lines of Code shown
  • 3 Links of Interest
http://southernmedia.org
This is my Source Code and I don't want to show it here
View Source Code only (as overlay)
// That code snippet belongs to Southern Media - http://southernmedia.org

var loaderImg = '<img id="loader" src="img/loader.gif" alt="Loading..." />';

$("#box").append(loaderImg);						

jQuery("#box").load("presentation.html", function(){
	$("#loader").hide();
});
/*
$('#nav a').remote('#box');
$('#logo a').remote('#box');
$.ajaxHistory.initialize();
*/

function masthearLoad() {

	jQuery("#home").click(function() {
				   
		if ( !jQuery(this).hasClass("home") ) {					   
								   
			jQuery("#box").fadeOut(200, function(){
	
				$("#loader").show();
	
				jQuery("#box").load("presentation.html", function() {	
																  
					$("#loader").hide();		
					
					jQuery("#masthead").animate({ height: 378 }, 300, 'easeInOutCirc', function(){ jQuery("#box").fadeIn(200); masthearLoad(); });
					
				});
				
			});
		
		}
	
		jQuery("#home").addClass('home');	
		
		jQuery("#navServices").removeClass('active');
		
		jQuery("#navPortfolio").removeClass('active');
		
		jQuery("#navContact").removeClass('active');
		
		return false;
			
	});	
	
	jQuery("#btnServices").click(function() {							  
										  
		if ( !jQuery(this).parent().hasClass("active") ) {
														  
			jQuery("#box").fadeOut(200, function(){
												 
				$("#loader").show();	
	
				jQuery("#box").load("services.html", function() {
															  
					$("#loader").hide();
															  
					jQuery("#masthead").animate({ height: 500 }, 300, 'easeInOutCirc', function(){ jQuery("#box").fadeIn(200); masthearLoad(); });
					
				});
				
			});
		
		}
	
		jQuery("#navServices").addClass('active');
		
		jQuery("#navPortfolio").removeClass('active');
		
		jQuery("#navContact").removeClass('active');
		
		jQuery("#home").removeClass('home');	
		
		return false;
			
	});
	
	jQuery("#btnPortfolio, .portfolio-link").click(function() {
				
		if ( !jQuery(this).parent().hasClass("active") ) {
				
			jQuery("#box").fadeOut(200, function(){
												 
				$("#loader").show();								 
	
				jQuery("#box").load("portfolio.html", function() {
					
					$("#loader").hide();
															  
					jQuery("#masthead").animate({ height: 500 }, 300, 'easeInOutCirc', function(){ jQuery("#box").fadeIn(200); masthearLoad(); });
					
				});
				
			});
			
		}
			
		jQuery("#navServices").removeClass('active');
		
		jQuery("#navContact").removeClass('active');
		
		jQuery("#navPortfolio").addClass('active');
		
		jQuery("#home").removeClass('home');	
		
		return false;
			
	});
	
	jQuery("#btnContact, .contact-link").click(function() {
				
		if ( !jQuery(this).parent().hasClass("active") ) {
				
			jQuery("#box").fadeOut(200, function(){
				
				$("#loader").show();
	
				jQuery("#box").load("contact.php", function() {
					
					$("#loader").hide();
															  
					jQuery("#masthead").animate({ height: 378 }, 300, 'easeInOutCirc', function(){ jQuery("#box").fadeIn(200); masthearLoad(); });
					
				});
				
			});
			
		}
			
		jQuery("#navServices").removeClass('active');
		
		jQuery("#navPortfolio").removeClass('active');
		
		jQuery("#navContact").addClass('active');
		
		jQuery("#home").removeClass('home');
	
		return false;	
			
	});

}

masthearLoad();



var testimNum = jQuery('#testimonial-block li').length;

var ii = 0;

//jQuery('#testimonial-block li').hide();

var testimRotate = function() {
	if (ii < testimNum) {
		if ( ii > 0 ) {
			jQuery('#testimonial-block li:nth-child(' + ii + ')').fadeOut('slow', function() {
				ii++;
				jQuery('#testimonial-block li:nth-child(' + ii + ')').fadeIn('slow');
			});
		} else {
			ii++;
			jQuery('#testimonial-block li:nth-child(' + ii + ')').fadeIn('slow');
		}
	} else {
		jQuery('#testimonial-block li:nth-child(' + ii + ')').fadeOut('slow', function() {
			ii = 1;
			jQuery('#testimonial-block li:nth-child(' + ii + ')').fadeIn('slow');
		});
	}
}

testimRotate();

var interv = setInterval("testimRotate()", 10000);

/**********************/

$("#latestWork a.image").fancybox({
	'zoomOpacity' : true,
	'overlayShow' : false
});

/**********************/

$('.works').jcarousel ({
	auto: 4, 
	wrap: 'both',
	scroll: 1,
	size: 3
});

/***********************/


$("#woo").click(function(){ window.location = "http://www.woothemes.com/amember/go.php?r=5074&i=b0"; return false; });
$("#mt").click(function(){ window.location = "http://www.mediatemple.net/go/order/?refdom=southernmedia.org"; return false; });


// DELETE ALERT MESSAGES CAUSED BY CAROUSEL
window.alert = function() { return };