JQUERY,scrollTo,向下滚动后,页面不会让我向上滚动一秒钟... Y? [英] JQUERY, scrollTo, after scrolling down, the page won't let me scroll up for a second... Y?

查看:166
本文介绍了JQUERY,scrollTo,向下滚动后,页面不会让我向上滚动一秒钟... Y?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用下面的jQuery来的重视甚至在标题中,它本质上滚动到页面底部的链接:

I'm using the following JQUERY to attach an even to a link in the header, which essentially scrolls to the bottom of the page:

$('#comment-count-btn').click(function(){
    $('html,body').scrollTo('#comment-wrapper', 500);
});

问题是,它一直滚动到页​​面(这是正确的)的底部,但后来当我试图向上滚动一点点,滚动条跳跃,仿佛它是锁着的一点点。

Problem is, that it scrolls all the way to the bottom of the page (which is correct), but then when I try to scroll up a tad, the scroll bar jumps, as if it's locked for a little bit.

任何想法?

推荐答案

尝试添加返回false; 中点击()函数的末尾。另外,尽量scrollTo只对身体不是HTML和身体。它也许混淆scrollTo。

Try adding return false; in the end of click() function. Also, try scrollTo only to the 'body' not both html and body. It maybe confusing scrollTo.

这篇关于JQUERY,scrollTo,向下滚动后,页面不会让我向上滚动一秒钟... Y?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆