Skip to content Skip to sidebar Skip to footer

Adding A Skip Button To Fastforward A .fadein / .fadeout?

Just to clarify, when you load my site I have a bit of text that fades in (quote), and then fades out. Afterwards a new bit of text (my brand name) fades in. Since I want people to

Solution 1:

You probably want jQuery .stop() (http://api.jquery.com/stop/)

So, if you add a Skip link:

<a href="#"id="skip">Skip</a>

The code would look like this:

$('#skip').click(function(e) {
    e.preventDefault();
    $('#quote, #brandname').stop(true, true);
});

The first "true" tells jQuery to remove any pending animations from the animation queue, the second "true" tells it to skip straight to the end of the animation.

Post a Comment for "Adding A Skip Button To Fastforward A .fadein / .fadeout?"