Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

michaelrjohnson

macrumors 68020
Original poster
Alright MR. I could really use some assistance.

I'm trying to create some very simple expanding/collapsing menus a la ALA articles old, and new. However, I'm having some difficulty. I'm a javascript beginner, but fluent in HTML and CSS.

I'm looking for a cross-platform/cross-browser compatible menu system. I just need some assistance in getting the JS in order.

Might anyone be able to help me further?
 
This type functions, though, I used a (now relativley) old Visual Quickstart Guide to get me to here. Apparently, document.all isn't standard, and it's been replaced by document.getElementById... but I've not been able to get it to work with that syntax.

<html>
<head>
<style type="text/css">

#menu1 {
display: none;
}
#menu2 {
display: none;
}
</style>
</head>
<body>

<span onclick="if (document.all.menu1.style.display == 'block') {document.all.menu1.style.display='none';} else {document.all.menu1.style.display='block';}">

<b>Menu1</b> </span> <br>
<span id="menu1">
option 1<br>
option 2<br>
option 3<br>
</span>
<p>

Option 4<br>

</body>
</html>
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.