Here''s a toggle function for the Slide effect as well... again, not
sure if it''s been implemented 100% correctly, but it seems to work.
Andrew
Effect2.SlideToggle = function(element) {
$(element).style.display == ''none''
? new Effect2.SlideDown(element).extend(arguments[1] || {})
: new Effect2.SlideUp(element).extend(arguments[1] || {})
}
On 6/24/05, Andrew Kaspick <akaspick@gmail.com>
wrote:> I wrote a simple toggle function similar to Element.toggle that will
> toggle a section between being up and down using the Blind effect.
>
> I''m relatively new to the code, so I''m not sure if
it''s implemented
> 100% correctly or if it can be done better. I am using it though and
> it seems to be working fine.
>
> Anyway, here''s the code and if you think it''s worthy of
being in the
> main lib, then go ahead and add it, otherwise, use it alone if you
> think it''s useful to you.
>
> Thanks,
> Andrew
>
> Effect2.BlindToggle = function(element) {
> $(element).style.display == ''none''
> ? new Effect2.BlindDown(element).extend(arguments[1] || {})
> : new Effect2.BlindUp(element).extend(arguments[1] || {})
> }
>