Forum Moderators: open

Message Too Old, No Replies

show/hide problem in firefox

show/hide not displaying correctly in firefox

         

j2theoey

8:49 pm on Oct 20, 2006 (gmt 0)

10+ Year Member



Ok I am using some javascript to make pop up windows when clicked. here it is:

<code>
<script type="text/javascript">
function show(div_id) {
// hide all the divs
document.getElementById('attractions').style.display = 'none';
document.getElementById('amenities').style.display = 'none';
document.getElementById('chains').style.display = 'none';

// show the requested div
document.getElementById(div_id).style.display = 'block';
}
function hide(div_id) {
// hide all the divs
document.getElementById('attractions').style.display = 'none';
document.getElementById('amenities').style.display = 'none';
document.getElementById('chains').style.display = 'none';
}
</script></code>

it works beautifuly execpt that in fire fox when you click the links in order e.g.

attractions
amenities
chains

you start from the top and click on each one after.... it hides the div but displays the new one with the height of the first div creating a blank space under it. You will just need to look at it here to really see what im talking about.

<snip>

Now whats wierd is if you go backwards it doesnt do this e.g.

chains
amenities
attractions

I can not figure out why for the life of me... If anyone knows how to accomplish this... or any fixes to the code i have all suggestions are appreciated.

also in case this may be where the problem is... here is the css.

<snip>

Thanks,
Joey

[edited by: DrDoc at 9:12 pm (utc) on Oct. 20, 2006]
[edit reason] No URLs, thanks. See TOS. [/edit]

DrDoc

9:13 pm on Oct 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This time, I think it is something related to the browser, and not your code. I can't see anything in your code indicating something which would cause this erroneous behavior.

Which version of Firefox are you testing in?

j2theoey

9:54 pm on Oct 20, 2006 (gmt 0)

10+ Year Member



the version im running is 1.0.3

i just upgraded... seems like that was the problem.... that can really piss a person off oh well