"I am enough of an artist to draw freely upon my imagination. Imagination is more important than knowledge. For knowledge is limited, whereas imagination embraces the entire world, stimulating progress, giving birth to evolution." -Albert Einstein
The secret to this is the load() function. It allows you to load portions, defined with CSS selectors, of any remote location. Top off this function with a smooth animation, and enjoy. Here is the code I used:
jQuery(document).ready(function(){
$('#loadlink').click(function(){
$(this).text('loading...');
$('#container')
.append('<div id="content"></div>')
.children('#content')
.hide()
.load('http://www.chrismaynard.net/header.php #header #navcontainer a',
function() {
// This is the callback function
$('#loadlink').hide();
$('#content').slideDown();
});
return false;
});
});
SPEAK / ADD YOUR COMMENT
Comments are moderated.