【发布时间】:2012-01-06 12:46:45
【问题描述】:
我正在使用这个 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;
});`
当用户点击链接时,你们能帮忙更改网址吗?
我知道我必须使用诸如 window.location.hash 之类的东西,但我真的不知道从哪里开始。
谢谢。
【问题讨论】:
标签: javascript jquery url url-rewriting