Click to See Complete Forum and Search --> : Scriptaculous Effect Fade, then redirect


johno12345
04-26-2007, 06:30 AM
Hi guys,

I'm pretty new to this ajax lark and i've been looking to implement a little on my page.

The Basic idea of what i'm trying to do is display an initial page which contains a set of images.
These images are surrounded by <div> tags which contain an effect from the scriptaculous library

<div id="centered" onclick="new Effect.Fade(this, {duration: 1})" style="cursor:pointer;">

What i'm looking for now is to add an extra part to this, once the <div> has faded to redirect to a new page.

Any ideas on this?

johno12345
04-26-2007, 09:08 AM
Managed to sort it

first of all i put in a delay+redirect script

function setRedirect() {
setTimeout("parent.window.location='index2.php'",1500);
return true;
}

the 1500 being the time of delay before redirect

then added it into the onclick event

onclick="new Effect.Fade(this, {Duration: 5}); setRedirect()"


Just thought i'd share...