$(document).ready(function() {
var contentWrapID = '___content-wrapper';
$('#content').wrap('<div id="' + contentWrapID + '"></div>');
function showNewContent() {
$("#" + contentWrapID).slideDown();
$('#load').fadeOut();
}
function pageload(hash) {
if(hash) {
$("#" + contentWrapID).load(hash + " #content",'',function(){
if($('img:last',this).get(0)) {
$('img:last',this).load(function(){
showNewContent();
});
} else {
showNewContent();
}
});
} else {
$("#" + contentWrapID).load("index.html #content");
}
}
$.historyInit(pageload);
$('#topnav li a').click(function(){
var hash = $(this).attr('href');
hash = hash.replace(/^.*#/, '');
$("#" + contentWrapID).slideUp(300,function(){
$.historyLoad(hash);
});
if(!$('#load').get(0)) {
$('#container').append('<span id="load">LOADING...</span>');
}
$('#load').fadeIn('normal');
$('#topnav li a').removeClass('current');
$(this).addClass('current');
return false;
});
});
........................
As far as I understand I have to replace this line:
var contentWrapID = '___content-wrapper';
with the json object:
var json = [{'id': 'content', 'wrapper': '__content-wrapper'},{'id': 'content2', 'wrapper': '__content-wrapper2'}];