Creating DHTML tree-like navigation
Learn how to create javascript (DHTML) tree-like navigation with items that expand and collapse.
The sections of colapsible items will be defined using a div tag.
We will first create a function that uses style.display property to expend or collapse a specific item.
|
<script language="javascript" type="text/javascript"> // Here we will switch between expand and collapse |
Place the above code between the head tags of your HTML document. Now lets create the navigation to put in the body of your HTML document.
|
<strong> <a href="javascript:navigate('home');">Home</a> </strong><br /> <strong> <a href="javascript:navigate('about');">About</a> </strong><br /> <strong> <a href="javascript:navigate('products');">Products</a> </strong><br /> |
Here is Sample:
Emir Plicanic owns and operates a web design company (