Ah. A simple and classic mistake. You have named all three functions
myFunction. They each fire, but the definition of the function is
whatever the last invocation is.
If you name each function uniquely, this will work. So in the second
instance, you would name the function myFunction2, then change the
afterFinish call to myFunction2, and outside of the function block,
call myFunction2().
By the way, you could wrap all of this into a single function, too,
and it would run all three blocks at once.
var myFunction = function(){
var d= 3;
$(‘a1’).morph(‘background-color:#fecccb’,{
queue: { scope: ‘a1’ },
duration:d
});
$('a1').morph('background-color:#ccccfe',{
queue: { position: 'end', scope: 'a1' },
duration:d
});
$('a1').morph('background-color:#3398cc',{
queue: { position: 'end', scope: 'a1' },
duration:d,
afterFinish:myFunction
});
$('b1').morph('background-color:#feccff',{
queue: { scope: 'b1' },
duration:d
});
$('b1').morph('background-color:#cccc98',{
queue: { position: 'end', scope: 'b1' },
duration:d
});
$('b1').morph('background-color:#666632',{
queue: { position: 'end', scope: 'b1' },
duration:d,
afterFinish:myFunction
});
$('c1').morph('background-color:#cccccc',{
queue: { scope: 'c1' },
duration:d
});
$('c1').morph('background-color:#cb9998',{
queue: { position: 'end', scope: 'c1' },
duration:d
});
$('c1').morph('background-color:#ffcb99',{
queue: { position: 'end', scope: 'c1' },
duration:d,
afterFinish:myFunction
});
}
myFunction();
That way you could just call one function at the end.
Walter
On Jul 16, 2008, at 2:16 PM, Sam wrote:
Hi Walter, need some more help… please
Please look at the link below… many thanks
http://www.thebookdesign.com/ani/index.htm
tutorials mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options