Hi,

I don't think effects queues will help you with this (unless someone's
written a script.aculo.us effect that changes the src of an image --
which someone may very well have done).

I see two choices:

1. Find or write a script.aculo.us effect that changes the src of an
image.  I'd recommend that you ensure that the effect doesn't "finish"
until the image is loaded.  Advantage here is that you can then reuse
it, publish it so others can use it (give back), etc., etc.  If you've
ever written an effect for script.aculo.us before, my suspicion is
that this would be easy to do.  If not, there'd be a learning curve.

2. Just write it for this situation, which would look something like
this:

* Add an afterFinish callback to your Squish effect.
* In the 'afterFinish' callback, hook the 'load' event of the img and
then change its src.
* In the 'load' callback, start the Grow effect.

Advantage to #2 is that it should be really quick to write.

HTH,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Jul 3, 7:27 pm, Kronprinz <xrsfors...@hotmail.com> wrote:
> I have an Image with the id of 'img1'.
>
> When I click on it I want to fire a function called animate().
>
> I'm trying to queue up some effects to get img1 to animate in the
> following manner:
>
> 1- Squish in to the top left-corner (http://wiki.github.com/madrobby/
> scriptaculous/effect-squish)
>
> 2- while img1 is "invisible" I want to change the image source
>
> 3- Then "Grow" it back from the top-left corner down. The "Squish"
> Effect in reverse essentially.
>
> Here's what I was able to come up with so far:
>
>     <img id="img1" src="images/1" onclick="animate()"/>
>
>     <script type="text/javascript" language="javascript">
>       // <![CDATA[
>
>       function animate()
>       {
>         new Effect.Squish('img1');
>         new Effect.Grow('img1', {queue: 'end'});
>       }
>
>       // ]]>
>     </script>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to