473,394 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Javascript Tabbed Menu Working in IE7 but not Firefox

First posting here so bear with me.

i'm working on a double tabbed menu system for a web aplpication, where the first row of 'divs' control visibility of the second row of 'divs'.

It all works fine in IE7 but when i open it in firefox i only get the top row with nothing being rendered for the bottom row.
some of the javascript is working because the top row changes colour when you roll the mouse over each tag.

Thanks in advance for any help in getting this to work in Firefox.

Oh and have tried using 'display' instead of 'visibility' with no success.

Javascript
Expand|Select|Wrap|Line Numbers
  1. // JavaScript Document
  2. var currMenu = 'homeSubMenu';
  3. var currTag = 'tag1';
  4. var lastMenu = currMenu;
  5. var lastTag = currTag;
  6. function switchMenu(choice, tag)
  7. {
  8.     document.getElementById(lastMenu).style.visibility = 'hidden';
  9.     document.getElementById(lastTag).style.backgroundColor = '#660066';
  10.     document.getElementById(lastTag).style.borderBottomColor = '#000000';
  11.     document.getElementById(choice).style.visibility = 'visible';
  12.     document.getElementById(tag).style.backgroundColor = '#6600CC';
  13.     document.getElementById(tag).style.borderBottomColor = '#6600CC';
  14.     lastTag = tag;
  15.     lastMenu = choice;
  16. }
  17. function resetMenu()
  18. {
  19.     document.getElementById(lastMenu).style.visibility = 'hidden';
  20.     document.getElementById(lastTag).style.backgroundColor = '#660066';
  21.     document.getElementById(lastTag).style.borderBottomColor = '#000000';
  22.     document.getElementById(currMenu).style.visibility = 'visible';
  23.     document.getElementById(currTag).style.backgroundColor = '#6600CC';
  24.     document.getElementById(currTag).style.borderBottomColor = '#6600CC';
  25.     lastTag = currTag;
  26.     lastMenu = currMenu;
  27. }
HTML
Expand|Select|Wrap|Line Numbers
  1. <div id='headmenu'>
  2.   <div class='toptags'>
  3.     <div id='tag1' onMouseOver="switchMenu('homeSubMenu', 'tag1')"><a href=''>Home</a></div>
  4.     <div id='tag2' onMouseOver="switchMenu('contactsSubMenu', 'tag2')"><a href=''>Contacts</a></div>
  5.     <div id='tag3' onMouseOver="switchMenu('projectsSubMenu', 'tag3')"><a href=''>Projects</a></div>
  6.   </div>
  7.   <div class='subtags' id='homeSubMenu'>
  8.     <div id='marquee'>
  9.       <marquee scrollamount="3">
  10.         <a href='1'>text 1</a><div class='spacer'></div>
  11.         <a href='2'>text 2</a><div class='spacer'></div>
  12.         <a href='3'>text 3</a><div class='spacer'></div>
  13.         <a href='4'>text 4</a><div class='spacer'></div>
  14.       </marquee>
  15.     </div>
  16.     <div id='homeViewAll'><a href=''>View All</a></div>
  17.   </div>
  18.   <div id='bottomClearTag' onMouseOver="resetMenu()"></div>
  19.   <div id='topClearTag' onMouseOver="resetMenu()"></div>
  20.   <div id='leftClearTag' onMouseOver="resetMenu()"></div>
  21.   <div id='rightClearTag' onMouseOver="resetMenu()"></div>
  22.   <div id='clearTag' onMouseOver="resetMenu()"></div>
  23.   <div class='subtags' id='contactsSubMenu'>
  24.     <div id='contactsDetails'><a href=''>Contact Details</a></div>
  25.     <div id='contactsAdd'><a href=''>Add Company</a></div>
  26.     <div id='contactsReviews'><a href=''>Reviews</a></div>
  27.     <div id='contactsPost'><a href=''>Post</a></div>
  28.     <div id='contactsMailShot'><a href=''>Mail Shots</a></div>
  29.   </div>
  30.   <div class='subtags' id='projectsSubMenu'>
  31.     <div id='projectsDetails'><a href=''>Project Details</a></div>
  32.     <div id='projectsAdd'><a href=''>Add Project</a></div>
  33.     <div id='projectsDocs'><a href=''>Documents</a></div>
  34.     <div id='projectsTeams'><a href=''>Project Teams</a></div>
  35.   </div>
  36. </div>
Relevant CSS
Expand|Select|Wrap|Line Numbers
  1. .subtags
  2. {
  3.     position:absolute;
  4.     width:768px;
  5.     height:24px;
  6.     margin-top:-1px;
  7.     margin-left:15px;
  8.     background-color:#6600CC;
  9.     border:1px solid #000000;
  10.     font-size:14px;
  11.     visibility:hidden;
  12.     z-index:-1;
  13. }
Mar 7 '07 #1
2 1735
acoder
16,027 Expert Mod 8TB
Welcome to TheScripts (TSDN).

Maybe the height 24px of the subtags div style is the problem. Increase the height to, say, 100px, but that makes all divs the same height and extra space at the bottom of the smaller div.
Mar 7 '07 #2
Welcome to TheScripts (TSDN).

Maybe the height 24px of the subtags div style is the problem. Increase the height to, say, 100px, but that makes all divs the same height and extra space at the bottom of the smaller div.
Thanks for the response but no improvement unfortunately.

As far as i can tell the css is working fine but the javascript isn't referencing the elements somehow (just can't figure out why).
Mar 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Peter Hoyle | last post by:
I'm trying to generate a tabbed menu system that will wrap to the next line when necessary. I tried using the css shown on this website http://www.sitepoint.com/print/accessible-menu-tabs It...
4
by: Ringo Langly | last post by:
Hi everyone, We're using an outside vendor to provide some content for our website, and they use the http_referer variable to verify their content is only viewed from subscribing customers. ...
23
by: ivan | last post by:
AJAX is a stupid and confusing word. People is wondering for something that programmers have used for many years. Javascript + Xml and asynchronous requests is not new. People started to speak...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
4
by: lmarceglia | last post by:
Hi, I have this website that doesn't work in Firefox 1.5: www.pianetaluca.com The HTML source is: <TITLE>PianetaLuca</TITLE> </HEAD>
2
by: KC | last post by:
Hi, Every JavaScript executive context has a top-level window and we can use window.open() to open another window ... Does this related to Windows created by click on "File"->"New Window" or...
12
by: tim | last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus in firefox. On my sub3 menus i have more than one line of text in some places. firefox does not recognise that there is more...
1
by: Rewire | last post by:
This script seems to work fine with firefox but not with IE. It just sets style="display:none" or style="display:" to show / hide submenu items on my menu. I've just tried making it save to a cookie...
1
by: Mig | last post by:
I just purchased a Wordpress theme and am customizing it. It uses a javascript tabbed content area with a script called tabber.js. I'd already made dozens or hundreds of changes in various...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.