//when document loads
$(document).ready(function() {
//navigation item is clicked
$('.nav_item').click(function() {
//get the clicked nav items id
var nav_item = $(this).attr("id");
var location_to_load = nav_item + '.html';
//load the loading html then the page
$('#sliding_content_container').load('loading.html', null, showResponse);
//load the page
function showResponse(){
$('#sliding_content_container').delay(900).load(location_to_load);
};
//dont refresh
return false;
});
});
Hey, I'm learning Jquery and just wondered why I can't call a "loading page" and then the destination with a delay, it seems everything I try doesn't work for instance adding .delay on or chaining the functions..
any help will be great, I'm giving jquery a good old crack.
thanks