Jump to content

expanding/collapsing a div in FF


Anarchatos

Recommended Posts

Hi, I'm not entirely sure whether this should be in the CSS forum or the Javascript forum, anyway:

 

I've got a fairly simple script to expand or collapse a div. It works perfectly in IE but it messes up the height of my entire page in FF (upon collapsing the div, the page keeps its old height, so then I get a huge white space below my page).

 

Here's part of my code:

 

CSS:

.expand {
padding: 0px 0px 0px;
overflow: hidden;
}

.collapse {
display: none;
overflow: hidden;
}

 

Javascript:

function swap(expand) {
x = document.getElementById(expand);
if (x.className == "expand") {
x.className = "expand collapse";
} else {
x.className = "expand"; 
}
}

 

Body:

onClick="swap('Liveset_{$liveset_id}');"

 

Here's the page I'm talking about: http://ismusic.sc11.co.uk/livesets.php

 

Scroll down a bit and skip the first 3 entries, only the last 7 per page are supposed to be able to expand/collapse. But like I said: in FireFox, after collapsing again, it just keeps the old height and screws up the entire page.

Link to comment
https://forums.phpfreaks.com/topic/95250-expandingcollapsing-a-div-in-ff/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.