固定位置的div在滚动FireFox的同时移动到侧面,在其他浏览器中正常工作 [英] Fixed positioned div moves to the side while scrolling the in FireFox, works fine in other browsers

查看:127
本文介绍了固定位置的div在滚动FireFox的同时移动到侧面,在其他浏览器中正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站上有两个页面的布局相同。每页在右侧栏中都有一个div,在jquery的帮助下,它会在您向下滚动页面时变为类。



我注意到其中一页上出现了奇怪的行为在FF。



在此页上 http://bit.ly/ QDhrz8 ,当我开始向下滚动时,右侧栏中的div只在Firefox中右移。 Chrome和IE可按预期工作。



在另一页 http:/ /bit.ly/RLZ4ZK 它的工作原理应该不会在scroll div上正确移动,并且在FireFox,Chrome,IE中没有问题的情况下也是如此。



这两个页​​面使用相同的布局,css和java代码。



是什么导致div在本页跳转 http://bit.ly/QDhrz8 在Firefox?

解决方案

我不能说为什么会发生这种情况,但我发现你可以通过改变这一行来消除跳跃效应:

 < td width =664valign =topclass =content2> b 




< td valign =topclass =content2>

我相信在html中设置的宽度会以某种方式与 padding发生冲突 - 但我不能说这是真正的原因,但至少上面的修复似乎解决您的问题在FF


I have 2 pages on my site that have the same layout. Each page has a div in the right sidebar that with the help of jquery changes it's class when you scroll down the page.

I noticed a strange behavior on one of the pages in FF.

On this page http://bit.ly/QDhrz8 when I start to scroll down, div in right sidebar shifts to the right in Firefox only. Chrome and IE works as intended.

On the other page http://bit.ly/RLZ4ZK it works as it should without shifting to right on scroll div and it works the same way without issues in FireFox, Chrome, IE.

Both of the pages use the same layout, css and java code.

What causes the div to jump on this page http://bit.ly/QDhrz8 in Firefox?

解决方案

I cannot say why this is happening, but I found out that you can get rid of the "jumping" effect by changing this line:

<td width="664" valign="top" class="content2">

to this:

<td valign="top" class="content2">

I believe that the width set in the html, somehow clashes with the padding - but I can't really say that it's the true reason, but at least the fix above seems to fix your issue in FF

这篇关于固定位置的div在滚动FireFox的同时移动到侧面,在其他浏览器中正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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