[Proto-Scripty] Re: Effect.toggle('BLIND'); select by class not id
Try this: a href=javascript:; id=toggleswitchToggle Blind/a Below goes in a script tag in the head document.observe('dom:loaded', function (){ $('toggleswitch').observe('click', function () { $$('.class2').each(function (d) { Effect.toggle(d, 'blind'); }); }); }); On Fri, Jun 12, 2009 at 7:47 AM, Gatsman jgats...@gmail.com wrote: Hi is it possible to select a Element by it’s class? I want to blind 2 div with one click and id are unique. for Example: a href=# onclick=Effect.toggle('class2','BLIND'); return false;Toggle blind/a div id=d2 class=”class2” style=display:none;div ptext/p /div/div Thanks, regards John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Effect.toggle('BLIND'); select by class not id
Thanks Rick but I found an other way 2 minutes ago I added this under the head script type=text/javascript function blind1(){ Effect.toggle('id 1 here','BLIND'); return false; } function blind2(){ Effect.toggle('id 2 here','BLIND'); return false; } /script And loaded the functions onclick a href=# onclick=blind1(); blindgr2;Click Me/a Thanks again for your time --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Effect.toggle('BLIND'); select by class not id
The way i shared with you allows you to do this task without repeating without repeating the code. Yes... i did that on purpose. On Fri, Jun 12, 2009 at 10:49 AM, Gatsman jgats...@gmail.com wrote: Thanks Rick but I found an other way 2 minutes ago I added this under the head script type=text/javascript function blind1(){ Effect.toggle('id 1 here','BLIND'); return false; } function blind2(){ Effect.toggle('id 2 here','BLIND'); return false; } /script And loaded the functions onclick a href=# onclick=blind1(); blindgr2;Click Me/a Thanks again for your time --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---