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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.