SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: Problem: Expandable Menu
-
Jan 1, 2008, 07:15 #1
- Join Date
- Jan 2008
- Posts
- 1
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Problem: Expandable Menu
I have a problem. A simple drop down menu that works fine locally on my machine, will not work online after upload.
For some reason the image disappears after clicking to open the nav menu. I want the image to stay visible before & after opening.
Anyone know what the problem could be?
The CSS
Code:#panel{display: none;margin-left: 10px;} #panel a{font-family:verdana; font-size:8pt; color:#000099;font-weight:bold}
The Java Script
Code:<script language="JavaScript" type="text/javascript"> <!-- function ShowPanel() { if (document.getElementById('panel').style.display == 'block') { document.getElementById('panel').style.display = 'none'; document.getElementById('up_down').src = "images/redarrow.gif"; } else { document.getElementById('panel').style.display = 'block'; document.getElementById('up_down').src = "images/redarrow.gif"; } } //--> </script>
The HTML
Code:<div style="width:255px;padding:0 0 0 25px"> <a href="JavaScript:void(0)" onclick="ShowPanel();"><img id="up_down" src="images/redarrow.gif" width="32" height="32" alt="categories" border="0" class="mid"><b class="tools">Categories</b></a> </div> <div id="panel"> <div style="width:160px;padding:0 0 20px 25px;font:8pt Verdana,sans-serif;line-height:1.5em;"> <a href="stuff.php">My Stuff</a> <br><a href="download.php">Download</a> <br><a href="contact.php">Contact</a> </div> </div>
-
Jan 3, 2008, 05:07 #2
- Join Date
- Jun 2007
- Location
- London, UK
- Posts
- 728
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Can I suggest you use a completely CSS expandable menu, rather than a JavaScript one? In my opinion the ones from CSS Play are the best.
Honda Civic Forum - UK Civic Forum
Web Host Reviews - Independent, honest host reviews
My Portfolio - Simplicity is the ultimate sophistication
Bookmarks