JQuery fadeout fading out too fast

Spread the love

Question Description

I am trying to get a paragraph tag to fade out over 10 seconds, however it is fading out much faster than the intended 10 seconds.



If you click on this paragraph you'll see it just fade away.

Practice As Follows

Drop the quotes to make it work with milliseconds, otherwise it will just use the default value, as “10000” is a string and not a time value, and it’s not an accepted string like “slow” or “fast”.

$("p").click(function () {
    $("p").fadeOut(10000);
});

Also, I like to reference things within scope like this :

$("p").on('click', function () {
    $(this).fadeOut(10000);
});

FIDDLE

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.