sitehost
06-20-2011, 04:09 PM
1) Script Title:
Animated Collapsible DIV V2.4
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm
3) Describe problem:
I used a simplified version of this script to create 15 questions on my web page. When a question is clicked, the answer slides down beneath it. When another question is clicked the previous answer slides up (disappears) as the new answer slides down below the newly clicked question. I would like each question to change color once it is clicked. This way the color change will let readers know which questions they have already clicked. I have scripted the code (example below) in an HTML script box on my web page. My website is created using Yahoo PageBuilder. I would appreciate knowing what coding I can add to get the questions to change from "#996600" to color "#999999" when clicked.
I am not familiar with scripting so this has been a a trial and error process for me. But I'm very pleased thus far with the clean look and function of this simplified script.
I will appreciate your assistance. Thank you.
<!DOCTYPE HTML>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="animatedcollapse.js">
/***********************************************
* Animated Collapsible DIV v2.4- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<script type="text/javascript">
animatedcollapse.addDiv('q1', 'fade=5,speed=300,group=questions,hide=1')
animatedcollapse.addDiv('q2', 'fade=5,speed=300,group=questions,persist=0,hide=1')
animatedcollapse.addDiv('q3', 'fade=5,speed=300,group=questions,hide=1')
animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
//$: Access to jQuery
//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
//state: "block" or "none", depending on state
}
animatedcollapse.init()
</script>
<p>
<a href="javascript:animatedcollapse.show('q1')"><font color="#996600" face="Trebuchet MS" style="font-size:10pt"><u>QUESTION</u></a></font><a href="javascript:animatedcollapse.hide('q1')"></a>
</p>
<div id="q1" style="width: 550px; background: #ffffff;"><font color="#333333" face="Trebuchet MS" style="font-size:10pt">ANSWER</i></font>
</div>
<p>
<a href="javascript:animatedcollapse.show('q2')"><font color="#996600" face="Trebuchet MS" style="font-size:10pt"><u>QUESTION</u></a></font><a href="javascript:animatedcollapse.hide('q2')"></a>
</p>
<div id="q2" style="width: 550px; background: #ffffff;"><font color="#333333" face="Trebuchet MS" style="font-size:10pt">ANSWER</font>
</div>
<p>
<a href="javascript:animatedcollapse.show('q3')"><font color="#996600" face="Trebuchet MS" style="font-size:10pt"><u>QUESTION</u></a></font><a href="javascript:animatedcollapse.hide('q3')"></a>
</p>
<div id="q3" style="width: 550px; background: #ffffff"><font color="#333333" face="Trebuchet MS" style="font-size:10pt">ANSWER</font>
</div>
Animated Collapsible DIV V2.4
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm
3) Describe problem:
I used a simplified version of this script to create 15 questions on my web page. When a question is clicked, the answer slides down beneath it. When another question is clicked the previous answer slides up (disappears) as the new answer slides down below the newly clicked question. I would like each question to change color once it is clicked. This way the color change will let readers know which questions they have already clicked. I have scripted the code (example below) in an HTML script box on my web page. My website is created using Yahoo PageBuilder. I would appreciate knowing what coding I can add to get the questions to change from "#996600" to color "#999999" when clicked.
I am not familiar with scripting so this has been a a trial and error process for me. But I'm very pleased thus far with the clean look and function of this simplified script.
I will appreciate your assistance. Thank you.
<!DOCTYPE HTML>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="animatedcollapse.js">
/***********************************************
* Animated Collapsible DIV v2.4- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<script type="text/javascript">
animatedcollapse.addDiv('q1', 'fade=5,speed=300,group=questions,hide=1')
animatedcollapse.addDiv('q2', 'fade=5,speed=300,group=questions,persist=0,hide=1')
animatedcollapse.addDiv('q3', 'fade=5,speed=300,group=questions,hide=1')
animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
//$: Access to jQuery
//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
//state: "block" or "none", depending on state
}
animatedcollapse.init()
</script>
<p>
<a href="javascript:animatedcollapse.show('q1')"><font color="#996600" face="Trebuchet MS" style="font-size:10pt"><u>QUESTION</u></a></font><a href="javascript:animatedcollapse.hide('q1')"></a>
</p>
<div id="q1" style="width: 550px; background: #ffffff;"><font color="#333333" face="Trebuchet MS" style="font-size:10pt">ANSWER</i></font>
</div>
<p>
<a href="javascript:animatedcollapse.show('q2')"><font color="#996600" face="Trebuchet MS" style="font-size:10pt"><u>QUESTION</u></a></font><a href="javascript:animatedcollapse.hide('q2')"></a>
</p>
<div id="q2" style="width: 550px; background: #ffffff;"><font color="#333333" face="Trebuchet MS" style="font-size:10pt">ANSWER</font>
</div>
<p>
<a href="javascript:animatedcollapse.show('q3')"><font color="#996600" face="Trebuchet MS" style="font-size:10pt"><u>QUESTION</u></a></font><a href="javascript:animatedcollapse.hide('q3')"></a>
</p>
<div id="q3" style="width: 550px; background: #ffffff"><font color="#333333" face="Trebuchet MS" style="font-size:10pt">ANSWER</font>
</div>