Expanding/Contracting DIVs

Results 1 to 3 of 3

Thread: Expanding/Contracting DIVs

  1. #1
    Join Date
    Dec 1969

    Default Expanding/Contracting DIVs

    I have a menu with different categories, and I want the contents of each category to expand/contract when you click on it. It is very similar to the left menu at Webmonkey (http://www.webmonkey.com) only I am trying to make the coding much simpler. I use DIVs and the "display" style attribute for each category name and each of its contents. <BR><BR>The first problem I have is that when I first load the page, even if I have set the "display" property to "none", all of the contents of each category still appear. Secondly, when I click on the Parent Categories, they do not expand/contract like they should. The menu is located at: http://www.ghqnet.com/test3.asp<BR><BR>Any help would be appreciated. I am weak at Javascript so please really explain or provide correct code :) Thanks so much.

  2. #2
    Dan Evans Guest

    Default RE: Expanding/Contracting DIVs

    Not a solution, just some advice. Try littering the code with alerts to make sure that the variables flying about are exactly what you expect them to be and that the code isn&#039t hitting a problem and just dropping straight out of a function.<BR><BR>-Dan Evans

  3. #3
    Dan Evans Guest

    Default RE: Expanding/Contracting DIVs

    If you&#039re still having trouble, drop me a line. I have a very similar menu (Ok, ok, I stole the layout from yours!) which is now working fine in all the browsers I&#039ve tried.<BR><BR>Email me at danjevans@hotmail.com and I&#039ll send you a fully commented copy.<BR><BR>-Dan Evans

Posting Permissions

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