Script.aculo.us and Toggle Effect |
[eluser]TDSPower[/eluser]
Hello, I am installing Script.aculo.us in my application, I want to do a Toggle Effect. I use the CI Ajax Library. To put a graphical I have to use this : Code: <span onclick=\"".$this->ajax->visual_effect('BlindDown','affichage',null)."\">Click for Effect.toggle demo (blind)</span> All is allright, but for the Toggle Effect I need on more parameter : Quote:Effect.toggle(element, ['appear' | 'slide' | 'blind'], [options] ); So how can I do ? I want it to be "blind" but it isn't an option... The best would be : visual_effect('Toggle','affichage','blind',null) but it doesn't work... Thanks, François JAGUELIN
[eluser]Pascal Kriete[/eluser]
The problem here is that toggle isn't a visual effect. Toggle comes from the prototype library, scriptaculous just allows you to add a visual effect to it. You would probably be best off to just code it yourself. Also, putting javascript in the body isn't a good idea, it doesn't degrade very nicely. I would suggest just writing your own event handler.
[eluser]David Rothera[/eluser]
It doesnt require much more code just to do it by hand, instead of using the AJaX library just: Code: <a href="#" onclick="new Effect.toggle(’affichage’,’blind’,null)">Click here to make affichage disappear</a>
[eluser]TDSPower[/eluser]
Thanks, your solution is good. I was looking the code of the Ajax CI Library and I have found another solution : Code: $this->ajax->visual_effect('toggle_blind','affichage',null) Thanks ! |
Welcome Guest, Not a member yet? Register Sign In |