javascript / jquery让我的页面加载一半

时间:2016-02-03 13:26:15

标签: javascript jquery html scroll

当我加载页面时,我得到了他的奇怪的错误,我的页面滚动到某处的中间位置。该网站可以在这里查看。 http://wilpegroup.webshoptool.nl/

我不知道出了什么问题,但我猜它在下面这个脚本的某处,因为滚动脚本。

$(function() {
  $('a[href*=#]:not([href=#])').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
      var target = $(this.hash);
      target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
      if (target.length) {
        $('html,body').animate({
          scrollTop: target.offset().top
        }, 1000);
        return false;
      }
    }
  });
});

如果你们需要更多信息,我希望这是足够的信息。

0 个答案:

没有答案
相关问题