//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;
});
});
嘿,我正在学习 Jquery,只是想知道为什么我不能调用“加载页面”,然后延迟调用目的地,似乎我尝试的一切都不起作用,例如添加 .delay 或链接函数..
任何帮助都会很棒,我正在给 jquery 一个很好的旧破解。
谢谢