Hi Kevin,

Assuming your transition is the $('div.box').hide() - then:

$('a').click(function() {
  var url = this.href;
  $('div.box').hide('slow', function() {
    // called once transition is complete
    setTimeout(function() { window.location = url; }, 2000); //
redirect 2 seconds after the transition
  });
});

Your code is pretty close, though I've added the callback in the hide
effect.

Hope that helps.

On Apr 22, 11:38 pm, Kevin <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Quick question.regarding jquery. I want to create a transition out,
> whenever anyone clicks on a link on a page, so ned to capture the
> href, show the transition then go to that page.
>
> I've seen some methods of delaying using fake transitions and also
> setTimeout, but despite searching quite a lot, I'm unsure how to pass
> the href as a parameter to those functions. Could anyone point me in
> the right direction?
>
> This is roughly what I'm doing
>
>         $("a").click(function(){
>                 targetURL = this.href;
>                 $("div.box").hide("slow");
>                 goAfterDelay(this.href);       // pseudo code for what
> i need to achieve
>                 return false;
>         }
>
> Any ideas?
>
> Thanks,
>
> - Kevin

Reply via email to