Search Results

Search found 1 results on 1 pages for 'jclu'.

Page 1/1 | 1 

  • In jquery Set a delay to fade out or fadeout right away on click

    - by JClu
    I am trying to right a script for a notification popup. I wan't the popup to fade out after X seconds or fadeout when the user clicks on the message. I can get both effects to work individually but when I try to combine them fadeOut works. This is my code so far: function notify(data, type) { switch(type) { case "success": $('#notify').html(data) .removeAttr("style") .addClass('notifySuccess') .click(function() { $("#notify").fadeOut(); }) .delay(5000).fadeOut(); break; case "error": $('#notify').html(data) .removeAttr("style") .addClass('notifyFailure') .click(function() { $("#notify").fadeOut(); }) .delay(5000).fadeOut(); break; } }

    Read the article

1