问题描述:

Try going between contact and the others on crossfat.dk. It basicly takes the width of the previous content, animates that height and then jumps. An answer could be to set a height of the largest content, but that would be ugly. Here is the code:

$(document).ready(function() {

$('nav ul li a').click(function(){

var toLoad = $(this).attr('href')+' #content';

$('#content').slideUp(500,loadContent);

$('#load').remove();

$('#wrapper').append('<span id="load">LOADING...</span>');

$('#load').fadeIn('normal');

window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);

function loadContent() {

$('#content').load(toLoad,'',showNewContent())

}

function showNewContent() {

$('#content').slideDown(1000,hideLoader());

}

function hideLoader() {

$('#load').fadeOut('normal');

}

return false;

});

Thanks!

相关阅读:
Top