tags:

views:

11

answers:

1

I want to display some images but, at the of that, I would like to redirect.

$(document).ready(function() {
    $('.intro').cycle({
        fx: 'fade'
    });
window.location.replace("http://www.something.com");
});

This will not work, it seems that js don't wait for the intro to finishes. Should I use a callback here?

Can I have some help here?

UPDATE:

The alert string never appears! :(

      $(document).ready(function() {
      $('.intro').cycle({
      fx: 'fade', 
window.location.replace("http://www.something.com"); }
      end: function() {window.alert("ola");}
      });
  });
+1  A: 

A callback is indeed what you want. Check out the end option for the cycle plugin. The following should do it.

end: function() {window.location.replace("http://www.something.com");}
Jason McCreary
I've updated my question with a failed example on using end: maybe i'm doing something wrong... :s
MEM
True, I just have to use autostop: before using it. Thanks a lot.
MEM