Javascript expanding menus
Hi
I wonder if someone could provide me with some sample code for what I'm trying to do. I've looked for similar code at DynamicDrive and JavascriptSource but can't find any!
What I'm trying to do is have three categories
+ cat 1
+ cat 2
+ cat 3
When the user clicks on "cat 1" it expands into more information, like so:
+ cat 1
- more information appears here
+ cat 2
+ cat 3
Surely this is simple enough. I've tried looking at the Microsoft site and lifting code off their expandable menus but the giants code seems a little too complex for this simple (surely?) operation?
Thanks for any help you can give.
- wil
Vincent Puglia posted this at 19:36 — 9th December 2001.
They have: 634 posts
Joined: Dec 1999
Hi William,
As Heinlein said, TANSTAAFL
There are innumerable script sites (brainjar and 2guysfromRollo (or somesuch) come to mind) But, they invariably require modifications.
If you are interested in writing your own, you might find the dHTML script/tutorials at my site (GrassBlade) helpful.
Vinny
Where the world once stood
the blades of grass cut me still
Wil posted this at 09:34 — 10th December 2001.
They have: 601 posts
Joined: Nov 2001
Hi
As I stated in my message, I have actually been to look around only to find complex and clumsy results.
I was looking for some specific, and very much trimmed down.
- wil
Vincent Puglia posted this at 14:37 — 10th December 2001.
They have: 634 posts
Joined: Dec 1999
Hi William,
Here you go, I adapted this from the "Self-Adjusting Layers" script/tutorial at my site (GrassBlade). Note:
1) you will have to add images for "+" and "-" signs.
2) you can kill or modify the font commands
3) it will not work with NN4+; if you want to make it NN4+ compatible, see the "dHTML: an Introduction" script/tutorial at my site
<script language="javascript">
</script>
The Learning Curve
Cascading Selects 1
Select & Go Menus
Alert Tricks
I, Object
Roldex 1
Roldex 2
Roldex 3
Vinny
Where the world once stood
the blades of grass cut me still
Wil posted this at 16:33 — 10th December 2001.
They have: 601 posts
Joined: Nov 2001
Thanks. I'll use SPAN instead of DIV as I'm not a huge fan of absolute positioning wieth various monitor sizes.
Cheers
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.