Hi all,
I''m having trouble with my expand/contract all link.
Here''s my js:
function blindAll(){
if (action == "expand") {
Effect.toggle(''1'',''blind'');
Effect.toggle(''2'',''blind'');
Effect.toggle(''3'',''blind'');
Effect.toggle(''4'',''blind'');
Effect.toggle(''5'',''blind'');
if ($(''actionLabel'').innerHTML == ''Expand
All''){
$(''actionLabel'').innerHTML = ''Contract
All'';
}else{
$(''actionLabel'').innerHTML = ''Expand All'';
}
}
Here''s my HTML:
<a
href="javascript:blindAll(''expand'');"><span
id="actionLabel">Contract All</span></a>
<br />
<div id="1" style="width:200px;height:50px; border:1px dashed
red;"
onclick="Effect.BlindUp(this.id)">some stuff 1</div>
<div id="2" style="width:200px;height:50px; border:1px dashed
red;"
onclick="Effect.BlindUp(this.id)">some stuff 2</div>
<div id="3" style="width:200px;height:50px; border:1px dashed
red;"
onclick="Effect.BlindUp(this.id)">some stuff 3</div>
<div id="4" style="width:200px;height:50px; border:1px dashed
red;"
onclick="Effect.BlindUp(this.id)">some stuff 4</div>
<div id="5" style="width:200px;height:50px; border:1px dashed
red;"
onclick="Effect.BlindUp(this.id)">some stuff 5</div>
Really simple, if I click on any of the divs, they should blindUp. If
I click contract all, everything changes state from blindup to
blinddown. but the one div that is blindup, is now blind down. so
I''ll show that one div.
How do I get all the divs to blinddown if one of the divs is already
blinddown (it shouldnt toggle basically).
Try out my code and you''ll see what I mean. If anyone knows where I
can find code to do what I want, that would be great too.
Thank you!
Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---