Am 21.10.2005 um 03:29 schrieb orixilus:
> 1. can someone give me an example usage of { afterfinish: }? I
> tried several ways and just can''t get it. I was trying to deploy
an
> effect after another one had finished and just couldn''t do it.
>
> Effect.dropout (myElement, {afterfinish: function(element)
> { Effect.Appear (anotherElement); } } );
>
> a) why doesn''t this work?
> b) what''s the element argument for? should it be there?
>
Keep in mind that correct case is important in JavaScript, so you
need to use:
Effect.DropOut(''my_element_id'', {afterFinish: function()
{ Effect.Appear(''some_other_element_id'') });
Note that the callbacks like afterFinish get the effect object, not a
reference to the element.
This is described in more detail here: http://wiki.script.aculo.us/
scriptaculous/show/CoreEffects
For some examples look at the source of effects.js and see here:
http://wiki.script.aculo.us/scriptaculous/show/EffectsTreasureChest
> 2. using $(myElement).style.visibility doesn''t seem to work when
> myElement class is defined as visibility:hidden in the first place.
> I had to use document.getElementById.style.visibility to do it...
> is this normal?
>
If I get your question correctly, you''re using it wrongly. $() takes
DOM element ids, not CSS class names.