jQuery
New Wave Javascript
Posted: Tue Feb 14 15:57:50 EST 2006
From: John Resig <
jeresig at gmail.com
>
You should probably have one link for each section (I imagine) - so
you have some more code blocks like this:
$("#jQJSLink").toggle(function(){
$(this).html(" +/-");
$("#jQJSNews").slideUp("slow");
},function(){
$(this).html(" -/+");
$("#jQJSNews").slideDown("slow");
});
$("#jQFAQLink").toggle(function(){
$(this).html(" +/-");
$("#jQFAQ").slideUp("slow");
},function(){
$(this).html(" -/+");
$("#jQFAQ").slideDown("slow");
});
Of course, all of this is without any optimization of the code - which
could probably be done if you were looking to do multiple effects,
like this.
--John
On 2/14/06, Daniel Acuff <
jojowebdev at gmail.com> wrote:
>
Multiple Toggle Sections.
>
>
I wanted to take my toggle world to the next level and create a couple
>
sections.
>
>
My instinct tells me I can create a couple more sets in the script to make
>
it happen.
>
>
<script type="text/javascript">
>
$(document).ready(function(){
>
$("#jQLink").toggle(function(){
>
$(this).html(" +/-");
>
$("#jQNews").slideUp("slow");
>
},function(){
>
$(this).html(" -/+");
>
$("#jQNews").slideDown("slow");
>
});
>
>
/* $("#jQJSNews").slideUp("slow");
>
$("#jQJSNews").slideUp("slow");
>
*/
>
/* $("#jQFAQ").slideUp("slow");
>
$("#jQFAQ").slideUp("slow");
>
*/
>
>
});
>
</script>
>
>
But Would there also have to be a new variable name for jQLink ?
>
>
Thanks. p.s. refering to my page.
>
http://www.jojowebdesign.com/skills/javascript/javascript_content.asp
>
>
>
>
--
>
Dan Acuff
>
Sr. Web Designer, Sr. Web Developer
>
www.jojowebdesign.com
>
203.733.6336
>
jojowebdev at gmail.com
>
_______________________________________________
>
jQuery mailing list
>
discuss at jquery.com
>
http://jquery.com/discuss/
>
>
>
--
John Resig
http://ejohn.org/jeresig at gmail.com