Grow your CSS skills. Land your dream job.

JavaScript causes menu to disapear

  • # March 10, 2009 at 12:41 am

    I’ve got two sets of JavaScript on my website. The first JavaScript controls a two-level horizontal navigation bar, and the second JavaScript allows the changing of the sites theme by alternating the css file that is referenced. My problem is when these two codes are used together on the same page.

    Normally, when the page loads, a submenu appears beneath the main navigation menu. What’s happening is when I click on a button to change the sites them, the submenu will disappear in Internet Explorer (The problem is in IE only, everything works fine in Firefox, Safari and Opera). I’ve stretched my JavaScript coding capabilities to the max, and I can’t figure out how to solve this problem.

    A sample site can be seen here,
    and the code used for the site is below:

    The HTML:

    < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

    href="styles_green.css"/> href="styles_blue.css"/>

    onclick="switch_style('green');return false;"
    name="theme" value="Green Theme" id="green"/>
    onclick="switch_style('blue');return false;"
    name="theme" value="Blue Theme" id="blue"/>

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".