wood burning stoves*
The moose likes HTML, CSS and JavaScript and the fly likes Position: fixed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Position: fixed" Watch "Position: fixed" New topic
Author

Position: fixed

Ryan Schutte
Greenhorn

Joined: Apr 26, 2009
Posts: 13
I am having trouble getting an image to go where I want it to. There is too much code to give it all to you, so I'll give you what I think is relevant. The page is at http://www.natural-beauty.com/shopping/shopexd.asp?id=145635&template=tmp_newstyle.htm, click on Magazine Covers and move your mouse over the top magazine cover. Then, if you scroll all the way to the bottom, you'll see a larger image. I want it to be in the browser window and I thought fixed would do this. Here's what I have.

html at the bottom of the page


javascript - HideLarger will eventually be changed to none, I have it left in block so it stays and we can see what's happening. I have also tried inline instead of block


css - absolute would work perfect, if it would stay on the screen when you scroll... which is what I thought fixed was supposed to be, just like absolute except it doesn't scroll.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Helps to say what browser it fails in: http://tagsoup.com/cookbook/css/fixed/

Ryan Schutte
Greenhorn

Joined: Apr 26, 2009
Posts: 13
I'll figure out another way of doing it. I didn't think about mentioning the browser I'm using, but it is IE7 which looking back at the book I'm using, it says fixed should work on IE7, but that's the first IE that it should work on. There's too many browsers that it doesn't work on for me to use that technique, so instead of trying to figure out the problem with this - I'll figure out a new way of doing it.

Thanks for the help!
Ryan Schutte
Greenhorn

Joined: Apr 26, 2009
Posts: 13
Here is the code that I ended up with.... works pretty well.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Position: fixed