hi guys,
I have an expanding menu that i want to spice up with an "open" background graphic.
the image swaps are all handled with
CSS, and id like to keep it this way, problem is i can seem to figure out how to identify when a particular menu item is open, and therefore add the "over" graphic
heres my
html at the moment,
im thinknig i need to add a class when the onclick is true, but my javascript is pants so you guys might tell me a better way, i hope
- Code: Select all
<dl id="menu">
<dt onclick="javascript:show('smenu1');"><a href="#">CD's and Music</a></dt>
<dd id="smenu1">
<ul>
<li><a href="#">MP3 Players</a></li>
<li><a href="#">CD's and Music</a></li>
</ul>
</dd>
<dt onclick="javascript:show('smenu2');"><a href="#">Computing</a></dt>
<dd id="smenu2">
<ul>
<li><a href="#">Computers & Laptops</a></li>
<li><a href="#">Hardware</a></li>
<li><a href="#">Software</a></li>
<li><a href="#">Printers</a></li>
<li><a href="#">Satellite Navigation</a></li
<li><a href="#">MP3 Players</a></li>
<li><a href="#">Office Furnature</a></li>
<li><a href="#">Cameras</a></li>
</ul>
</dd>
<dt onclick="javascript:show('smenu3');"><a href="#">DVD's and Video</a></dt>
<dd id="smenu3">
<ul>
<li><a href="#">DVD's</a></li>
<li><a href="#">DVD Rentals</a></li>
</ul>
</dd>
<dt onclick="javascript:show('smenu4'); document.write('id="active"');"><a href="#">Electrical Goods</a></dt>
<dd id="smenu4">
<ul>
<li><a href="#">Home entertainment</a></li>
<li><a href="#">Satellite Navigation</a></li>
<li><a href="#">MP3 Players</a></li>
<li><a href="#">Kitchen Appliances</a></li>
<li><a href="#">Household Appliances</a></li>
</ul>
</dd>
</dl>
</div><!-- /leftdiv -->
you can see what im trying to do here :
- Code: Select all
<dt onclick="javascript:show('smenu4'); document.write('id="active"');">
hope someone can help witht his
Accu