copenndthagen
copenndthagen

Reputation: 50732

position:fixed difference in IE Vs Firefox

Lets say I have a main page which has a link that opens a modal div which has position:fixed and some width/height

Now I observe a behavior difference in IE Vs Firefox when this modal div is displayed i.e. ff we scroll the main window, In IE, the modal div also scrolls with the page; While in Firefox, the scrolling of main window does not have any impact on the modal div and it literally remains fixed.

Is there any way by which we can have the modal div scroll in Firefox like in IE ?

Upvotes: 0

Views: 442

Answers (2)

publicJorn
publicJorn

Reputation: 193

I agree with Dalal - It's IE acting wronly. position:fixed; means that an element is positioned with a certain x/y to your viewport, so of you want it to scroll with the page use position:absolute;

You may need to hack Thickbox in order to get this done.

Btw. Thickbox is a rather outdated lightbox variant. If you can, try to change to a newer one: http://planetozh.com/projects/lightbox-clones/

Upvotes: 2

Chris Morgan
Chris Morgan

Reputation: 90742

If you're wanting Firefox to behave like you're saying IE is, and have the DIV scroll with the page, you shouldn't be using position: fixed. You want just position: absolute.

Upvotes: 2

Related Questions