SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Dhtml Problem!!!!!

    I'm trying to make a menu that collapses using div tags can anyone help me out.

    this is the code that I am using:

    function switchMenu(obj) {
    var el = document.getElementById(obj);
    if ( el.style.display != "none" ) {
    el.style.display = 'none';
    }
    else {
    el.style.display = '';
    }
    }


    the only problem is the page loads with the menu open. I need it load with the menu collapse. Can anyone help me please???

  2. #2
    SitePoint Wizard Mike Borozdin's Avatar
    Join Date
    Oct 2002
    Location
    Edinburgh, UK
    Posts
    1,743
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just put
    Code:
    style="display: none;"
    To the menu tag.

  3. #3
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It worked!!!! Thank you mike. I will be sure to post my comments to this forum a lot more often. Again thank you.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •