jijopaulose / jscrollpane

Automatically exported from code.google.com/p/jscrollpane
0 stars 0 forks source link

jScrollPane shifting centered content in Safari/Chrome #244

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Loading a page causes position:fixed header/footer to shift to the left in 
Safari/Chrome (FF/IE are fine)
2. Upon refresh, it usually loads fine
3.

What is the expected output? What do you see instead?
Centered Layout. Instead it shifts header/footer to the left, which are using 
position:fixed. If I set them to position:absolute the problem goes away.

What version of the jScrollPane are you using? On what browser? And operating 
system? Newest. Safari/Chrome on Mac OSX.

Please provide a URL to a page displaying the problem.
http://madevisible.com/thefuture/anti-traffik-artists.html

Original issue reported on code.google.com by n...@thefutureforward.com on 12 Apr 2011 at 10:20

GoogleCodeExporter commented 9 years ago
SO the "fix I've come up with is to set "position:fixed" on the "header-inner" 
and "footer-inner" divs via jQuery instead of in my stylesheet, like so:

// Workaround for Safari/Chrome issue with "position:fixed" divs being set in 
CSS
$('#header-inner').css('position', 'fixed');
$('#footer-inner').css('position', 'fixed');

I placed this code AFTER I initialize scrollPane, and that seems to do the 
trick in Safari/Chrome. Still not sure why this fixes it, but I'm guessing it 
has something to do with scrollpane needing to be fully initialized before the 
fixed divs are set.

Anyhoo, not the greatest fix, but it'll work for now!

-Nick

Original comment by n...@thefutureforward.com on 13 Apr 2011 at 4:20

GoogleCodeExporter commented 9 years ago
Glad you figured out a solution :)

Original comment by kelvin.l...@gmail.com on 13 Apr 2011 at 1:42