469,951 Members | 2,754 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

Firefox display problem for display:block

Hi,

I'm developing a portfolio site, which contains a bunch of thumbnails wrapped in links: <a href="..."><img ... /></a>. A window.onload script inserts an onclick property into the links which changes their behaviour to load the big image in a <div> on the same page, instead of going to another site. For that purpose I have a <div><img ... /></div> construct in the page which is set to a fixed height and width and 'display: none' via CSS. The onload script changes the 'display: none' to 'block' (just '' doesn't work somehow).

I.e. non-JS enabled browsers display a bunch of thumbnails that open a new page when you click on them, JS enabled browsers can display them on the same page.

The problem is that the layout is slightly different with or without the hidden <div> container. Safari and Opera both resize the page properly and shift the other elements accordingly, Firefox does not. How can I make FF recalculate the space needed for the <div>?
Nov 14 '06 #1
1 2049
acoder
16,027 Expert Mod 8TB
Perhaps the div is absolutely positioned and needs to be relatively positioned with "position: relative".
May 29 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Jeff Thies | last post: by
18 posts views Thread by David Morris | last post: by
2 posts views Thread by Richard | last post: by
7 posts views Thread by Marc | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.