混合overflow-x,FireFox和Javascript的问题 [英] Problem mixing overflow-x, FireFox, and Javascript

查看:126
本文介绍了混合overflow-x,FireFox和Javascript的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,这个问题只发生在Firefox中。

First of all, this problem only happens in Firefox.

检查此示例页面以了解问题:
-removed -

Check this example page to understand the problem: -removed-

选择家中的任何页面。窗口将滚动到页面。然后,您可以使用鼠标滚轮向下滚动。这工作正常。但是如果你用鼠标抓住右边的滚动条,它会跳回到主页(左上角,第一个元素,是ENTIRE页面/网站的一部分)。

Select any page besides home. The window will scroll to page. You can then scroll down using the mouse wheel. This works fine. BUT if you grab the scroll bar on the right with your mouse it will jump back to the "home page" (the top left, first element, which is part of the ENTIRE page/website).

违规代码为:


#content {

#content{



overflow-x: hidden; /* <<problem maker */
overflow-y: auto;
width:100%;
background-color:white;
position:relative;
height:400px;
float:left;
min-width: 900px;




}

}

...如果我取消隐藏overflow-x(overflow-x:auto;)一切正常,但我得到一个不需要的水平滚动条。

... if I unhide overflow-x (overflow-x: auto;) everything works properly, but I get an undesired horizontal scroll bar.

我使用的是jquery ScrollTo插件,它是在#content内部创建div的位置,以创建滑动效果。显然,由于Firefox正在重置到默认加载位置,它不认为它应该曾经允许我水平滑动。

I am using the jquery ScrollTo plugin that is animating the position of the div inside #content to create the "sliding" effect. Apparently, because Firefox is "resetting" to the default load position, it doesn't think it should have ever allowed me to "slide" horizontally.

这是一个Firefox bug?或者ScrollTo插件中的错误?或者甚至jQuery?

Is this a Firefox bug? Or a bug in the ScrollTo plugin? Or maybe even jQuery?

有任何想法如何解决这个问题?解决方法的想法?

Any ideas of how to fix this? Workarounds ideas?

任何帮助非常感谢!谢谢!

Any help is much appreciated! Thanks!

推荐答案

解决方法:
隐藏另一个div下的滚动条。 Lame,但在我的情况下工作。

Workaround: Hide the scroll bar under another div. Lame, but works in my case.

这篇关于混合overflow-x,FireFox和Javascript的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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