I’m using this javascript code to animate and load my website!
$('.down-trigger').on('click', function () {
var toLoad = $(this).attr('href')+' #container';
$('#container').attr('id','to-go');
$('#wrapper').append('<div id="newcontainer"/>');
$('#newcontainer').load(toLoad, function () {
$('#newcontainer').append($('#container').children()).css({'position': 'absolute', 'top': '696px'});
$('#to-go, #newcontainer').animate({top:'-=691'},600, function () {
$('#to-go').remove();
var lastchild = $('.page:last-child'); // ignore these lines
var found = lastchild.find('div.slide'); // this one
if (found.length == 0) { lastchild.remove(); } // and this one
carousels(); // and this one too
});
$('#container').remove();
$('#newcontainer').attr('id','container');
searchform(); // these two lines can be ignored too
triggers(); // this is the second line to ignore
});
return false;
});`
Could you guys help to change the url when the user clicks a link?
I know I have to use something like window.location.hash but i really don’t know where to start.
Thanks.
1 Answer