chrome 中的锚标记无法正常工作?这是 chrome 错误吗?

Anchor Tag in chrome not working properly?Is this a chrome Bug?

我有一个网站 http://rethinkwaste.com.au/。单击第一张幻灯片时,我设置了一个锚点

<div id="illegal"></div>

在 google chrome 中第一次加载时,这似乎跳回到页面顶部。这是 chrome 错误吗?

如果我然后从滑块刷新或加载页面 link 它似乎工作正常。

问题可能是由于重复的 id #illegal,从您的网站代码我可以看到这个 id 使用了两次。删除不需要的或使用唯一 ID 并尝试。它应该工作

我认为它是 Chrome bug。所以经过一番搜索,我找到了这个解决方案。

jQuery(window).load(function(){
    var hashNum = 0;
    if (window.location.hash != ''){
        hashNum = window.location.hash.replace("#illegal", "");   
        console.log('hashNum: ' + hashNum); 
    };
    hashMenu = jQuery("#illegal").offset().top;
      jQuery('html,body').animate({
          scrollTop: hashMenu
    }, 1000);

});