The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Expandable text with Javascript, One text region at a time
mkenz125
post Jan 21 2013, 03:05 PM
Post #1





Group: Members
Posts: 9
Joined: 16-January 13
Member No.: 18,463



I am using expandable text regions on this webpage and I am trying to figure out how to make only one of the regions visible at a time (the previous ones disappear when another one is clicked). Does anyone know what I need to do to make this happen? Here is the page: http://www.thepioneers.tv/episode.html

I also have the abbreviated code right here.

CODE
<div class="text" id="testtext1">
<div align="center">
<div onClick="openClose('a1')" style="cursor:hand; cursor:pointer"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image7','','Media/episodebutt/welcome.png',1)"><img src="Media/episodebutt/welcomey.png" name="Image7" width="400" height="30" border="0" id="Image7" /></a></div>
<div id="a1" class="texter">
BLAH BLAH TEXT.<br /><br />
</div>
<br />

(a2...a7)

<div onClick="openClose('a8')" style="cursor:hand; cursor:pointer"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image14','','Media/Episodebutt/fall.png',1)"><img src="Media/Episodebutt/fally.png" name="Image14" width="420" height="30" border="0" id="Image14" /></a></div>
<div id="a8" class="texter">
BLAH BLAH TEXT.<br /><br />
</div>
<br /><br />
</div>


This post has been edited by mkenz125: Jan 21 2013, 03:05 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jan 21 2013, 05:19 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



Basically you need to loop through all expandable elements and close those that are open. Here's one version: http://forums.htmlhelp.com/index.php?s=&am...ost&p=43934
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
mkenz125
post Jan 21 2013, 06:39 PM
Post #3





Group: Members
Posts: 9
Joined: 16-January 13
Member No.: 18,463



How can I align this in the center?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jan 21 2013, 08:02 PM
Post #4


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



QUOTE(mkenz125 @ Jan 22 2013, 12:39 AM) *

How can I align this in the center?

The CSS auto margins that you use on http://www.thepioneers.tv/episode.html should work.
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 April 2024 - 09:54 PM