Quote:
Originally Posted by Eldarrion
Assign a class upon doing a show... not sure which framework we're discussing, but considering the topic, I'm guessing jQuery? Or is it something else? Anyways... after assigning a class on show, you can easily call that class and hide everything that has it, then clear it and after that assign it to the newly opened menus.
|
Thanks for the quick response, but as a newbie I'm not entirely sure how to apply your recommendation! My Javascript code is from a Tutorial at tutorials-db.com, but doesn't seem to say what framework it is :
function display (category) {
var whichcategory = document.getElementById(category);
if (whichcategory.className=="show") {
whichcategory.className="hide";
} else {
whichcategory.className="show";
}
}
and (a portion of) the HTML is :
<a href="javascript
:display('Services')" class="Group">Services</a>
<div class="hide" id="Services">
<a href="#" class="Option">Service 1</a>
<a href="#" class="Option">Service 2</a>
How do I assign a class to 'show'?