Forum Moderators: open

Message Too Old, No Replies

cross browser DOM

         

gleddy

10:12 am on Nov 10, 2004 (gmt 0)

10+ Year Member



heya,

I have a function that won't work in firefox, but I thought that I had created it cross browser...

it is:

function clearTabs() {// clear all bg color tabs during div changes
document.getElementById("jobsActive").style.display = 'none';
document.getElementById("carsActive").style.display = 'none';
document.getElementById("homesActive").style.display = 'none';
document.getElementById("moreActive").style.display = 'none';
}

function show_div(id) {// show divs and active tab for each section
// hide all the divs
document.getElementById("jobs").style.display = 'none';
document.getElementById("cars").style.display = 'none';
document.getElementById("homes").style.display = 'none';
document.getElementById("more").style.display = 'none';

// show the requested div
document.getElementById(id).style.display = 'block'; // turns on active div content layer
clearTabs();
document.getElementById(id + "Active").style.display = 'block'; // turns on active tab div layer
}

This just alternates between four divs that are controlled by one tab navigation... toggling the visibility of the divs.

all good in IE, but no joy in firefox. doesn't do anything.

is my syntax wrong?

cheers!

gleddy

12:15 am on Nov 11, 2004 (gmt 0)

10+ Year Member



hmm. well, it actually does work in both browsers... turns out that it is only when I refresh the page, that it goes a bit wonky in Firefox.

but when I load the page fresh (as in 'open file') it acts as it should.

strange. I figure 'refresh' and 'open' are the same thing really?