Firefox jquery scrollTo 闪烁错误
我在这里看到了很多讨论 Firefox 闪烁的帖子,但没有一个能完全描述我遇到的问题。
我有一个水平滚动网站、固定位置菜单和 jquery 插件 .scrollTo 处理下一个和上一个按钮。这在 Chrome 和 Safari 中效果很好(不知道 IE 怎么样),但在 Firefox 中,每次使用右上角和角落的箭头从左向右滚动时,都会出现闪烁。
我尝试将所有具有固定位置的元素设置为溢出:自动,但这没有任何作用。我不太熟悉 JS 或 Jquery,但我知道足以改变事情。任何帮助将不胜感激!
I've seen quite a few threads here talking about flickering in Firefox, but none that quite describe the problem I'm having.
I've got a horizontal scrolling website, fixed position menus, and the jquery plugin .scrollTo handling next and previous buttons. This works great in Chrome and Safari (don't know about IE), but in Firefox there is a flicker every time you scroll right of left with the arrows in the upper right and corner.
I've tried setting all the elements that have a fixed position to overflow:auto but that did nothing. I'm not super familiar with with JS or Jquery but I know enough to change things. Any help would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题是您没有取消点击功能中的默认浏览器操作。将代码更改为这样,闪烁就会消失:
Firefox 正在尝试“滚动到
#
”并同时进行动画处理。The problem is that you are not cancelling the default browser action in your click function. Change your code to this, and the flicker will go away:
Firefox is trying to "scroll to the
#
" and animate at the same time.在我对道格的帖子的页面可书签性发表评论后,我脑子里的灯亮了!
如果您需要书签功能,希望您能够适应您的脚本
Right after my comment on page bookmarkability on Doug's post, the light in my head turned on!
Hope you can adapt to your script, if you need bookmarkability