...

View Full Version : Positioned Div not working in Iframe in IE7



SinePhase
10-09-2007, 07:52 AM
Works fine in FF.
I add:
<style type="text/css">
#loadarea {position:fixed;
left: 310px;
top: 10px;
z-index: 100
}
</style>
into the header, then signify the iframe, or just a normal frame with something like <div id="loadarea">, but what I'm trying to position is a frame created by a thumbnail viewer .js. The frame only goes exactly where the code for the frame is put in the body, not at all where the position coordinates tell it to.

Also, just to be clear, this coding is within the source for an iframe.

Haven't seemed to be able to find any examples or posts of people having the same issue.
Hope someone has heard of this before and has an answer!

BarrMan
10-09-2007, 08:22 AM
* html #loadarea{
position: absolute;
}

SinePhase
10-09-2007, 08:35 AM
Thanks. Pretty close, but I do need it to be fixed so I don't have to keep duplicating script to keep the frame viewable while scrolling down the page, so I can keep having the content of the frame changed based on the viewer's mouseovers.

Is it not possible to do so? If anyone has an alternative I'm all ears (or eyes, for this matter).

BarrMan
10-09-2007, 08:49 AM
Thanks. Pretty close, but I do need it to be fixed so I don't have to keep duplicating script to keep the frame viewable while scrolling down the page, so I can keep having the content of the frame changed based on the viewer's mouseovers.


body{
height: 100%;
overflow-y:auto;
}
#loadarea {
display: block;
left: 310px;
top: 10px;
z-index: 100;
position:fixed;

}
* html #loadarea
{
position:absolute;
}

SinePhase
10-09-2007, 08:59 AM
body{
height: 100%;
overflow-y:auto;
}
#loadarea {
display: block;
left: 310px;
top: 10px;
z-index: 100;
position:fixed;

}
* html #loadarea
{
position:absolute;
}

I tried it like this:

<style type="text/css">

body{
height: 100%;
overflow-y:auto;
}
#loadarea {
display: block;
left: 310px;
top: 10px;
z-index: 100;
position:fixed;

}
* html #loadarea
{
position:absolute;
}
</style>

but it still only positions like it's absolute, not fixed. Maybe I missed something?

_peter_
10-09-2007, 09:42 AM
under IE7 position fixed works only in strict mode same as ie6

http://home.tampabay.rr.com/bmerkey/examples/fake-position-fixed.html

BarrMan
10-09-2007, 10:45 AM
Do you have a doctype?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Oh, just saw peter's post. Yea he's right. You need to have the doctype.

SinePhase
10-09-2007, 05:45 PM
That did it! Thanks a lot and for saving me a bigger head ache. I appreciate the help! :thumbsup:

SinePhase
10-11-2007, 12:17 AM
Just wanted to mention something a little weird about this: without that doctype, absolute positioning works fine for the main frame, but to position the frame from within the source of an iframe, I do have to put the doctype at the top or use the coding:

* html #loadarea{
position: absolute;
}

No big deal, just confused why it makes a difference?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum