在jQuery中更改哈希而不重新加载

我有以下代码:
$('ul.questions li a').click(function(event) {
    $('.tab').hide();
    $($(this).attr('href')).fadeIn('slow');
    event.preventDefault();
    window.location.hash = $(this).attr('href');
});

这只是淡化一个div,基于什么时候点击,但我想让页面的URL哈希标签更改时,你点击,以便人们可以复制和加入书签。此时,当哈希标记更改时,这将有效地重新加载页面。

是否可以更改哈希标记,而不是重新加载页面以防止跳跃效果?

解决方法

这对我有用
$('ul.questions li a').click(function(event) {
    event.preventDefault();
    $('.tab').hide();
    window.location.hash = this.hash;
    $($(this).attr('href')).fadeIn('slow');
});

检查这里http://jsbin.com/edicu演示与几乎相同的代码

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...