Forum Moderators: open
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!