Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FireFox window.pageYOffset acting wierd

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
i have been playing with keeping some side divs stationary on the screen while a middle section scrolls. using the html {height:100%; overflow:hidden;} CSS works fine except when I hover over a button, the side divs jump up the screen to the top of the page.

So I have tried using JS to reposition the divs relative to the current scroll position / window.pageYOffset , however in firefox code that I have working on another site is giving me an odd result, as you scroll the page the side divs seem to have there top position added to their current position so the gap between the top of the page and the divs gets bigger and bigger.

why is this happening?

URL :
What suggestion does anyone have on acheiving my design goal of keeping the left and right side divs "Fixed" - when IE doesn't support this property yet?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
ok worked out what was causing it,
Code:
#side_left_container > div {
  position: fixed;

So I guess the conclusion is , the easy way to do what I want is to use the attribute "position:fixed;" which is what it's designed for, the problem with this is I.E.6 doesn't support it!

the CSS trickery works for IE but has strange behaviour when hovering over links, and the JS reposition doesn't work if using the FireFox "position:fixed" CSS.

this reminds me of a famous saying...

You can please all the browsers some of the time, and you can please some of the browsers all the time, but you can't please all the browsers all of the time!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top