Welcome Guest, Not a member yet? Register   Sign In
Script.aculo.us and Toggle Effect
#1

[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:
&lt;span onclick=\"".$this-&gt;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
#2

[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.
#3

[eluser]David Rothera[/eluser]
It doesnt require much more code just to do it by hand, instead of using the AJaX library just:

Code:
&lt;a href="#" onclick="new Effect.toggle(’affichage’,’blind’,null)"&gt;Click here to make affichage disappear</a>
#4

[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 !




Theme © iAndrew 2016 - Forum software by © MyBB