Я использую этот код JavaScript для анимации и загрузки своего сайта!
$('.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;
});`
Не могли бы вы, ребята, помочь изменить URL, когда пользователь нажимает на ссылку?
Я знаю, что должен использовать что-то вроде window.location.hash, но я действительно не знаю, с чего начать.
Спасибо.