Hi folks, just joined the group.
I'm trying to create a template for mobile sites that makes the best use of the small screen
space. I'm using header links with the following script to show/hide the content below:
<a name="1" />
<h2><a href="#1"
onclick="document.getElementById('one').style.display=(document.getElementById('one').st
yle.display== 'block')?'none':'block';">SCHEDULE</a></h2>
<div id="one" class="text" style="display: none;">
text here
</div>
Here's an example online:
http://www.bushidodesigns.net/iphone/mobile/
It works great, but I want to make a modification; if a div is visible and someone clicks on
another link, I want the open one to close before the new one opens. My js is pretty weak,
so I can't figure out quite how to accomplish this. Ideally, I would also like the link to have
a different class when the div is open, so I can use a different background image (like a
down arrow).
Thanks in advance.
Dean H.