The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Javascript Expanding Menus
orienteering
post Feb 19 2012, 05:31 PM
Post #1





Group: Members
Posts: 8
Joined: 12-August 11
Member No.: 15,162



Hi all,

I am using the Indexhibit CMS to build a website. In one section I would like to have a list of names, that can each be clicked on to expand/collapse to reveal a bio/more info. I don't want this to be an accordion menu though, as I do want people to be able to expand multiple names at once.

I found the code below and it works well, but I don't know much about jscript and I want to edit a couple of things:

1. I would like to slow down the speed of expansion.
2. I would like the text, on expansion, to be the same size as the link text.

Can anyone help me out? Here is a test example: http://www.midastouchprojects.com/index.ph...issions/test-2/

And here is the code:

CODE
<script type="text/javascript"><!--
function toggleMe(a){
var e=document.getElementById(a);
if(!e)return true;
if(e.style.display=="none"){
e.style.display="block"
} else {
e.style.display="none"
}
return false;
}
// --></script>

<p><a href="#" onclick="return toggleMe('para1')"><b>Question</b></a></p>
<div id="para1" style="display:none" mce_style="display:none">
<b>Answer to Question</b>
</div>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th March 2024 - 10:26 PM