Sha256: 03bc4935bdec87e065a4b61b8a57fd1fb486c8feedc41557a3cdea35c8dc2c5b

Contents?: true

Size: 735 Bytes

Versions: 6

Compression:

Stored size: 735 Bytes

Contents

//
// Adding some animation to flash messages
// Idea from http://stackoverflow.com/questions/316278/timeout-jquery-effects
//
// Copyright (c) 2011 Kosmas Schütz
//

(function($) {

    //   Parameters are:
    //   time for fadeIn
    //   time the message is shown
    //   time for fadeOut

    $.fn.flashMessages = function(timeIn, timeStay, timeOut) {

        var el = $(this.selector + " .success, " + this.selector + " .notice, " + this.selector + " .warning, " + this.selector + " .error");
        el.fadeIn(timeIn);
        el.queue(function() {
            setTimeout(function() {
                el.dequeue();
            }, timeStay);
        });
        el.fadeOut(timeOut);
    };
})(jQuery);

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
compass-jquery-plugin-0.3.2.8 templates/jquery/jquery.flashMessages.js
compass-jquery-plugin-0.3.2.7 templates/jquery/jquery.flashMessages.js
compass-jquery-plugin-0.3.2.7.nil templates/jquery/jquery.flashMessages.js
compass-jquery-plugin-0.3.2.6 templates/jquery/jquery.flashMessages.js
compass-jquery-plugin-0.3.2.5 templates/jquery/jquery.flashMessages.js
compass-jquery-plugin-0.3.2.4 templates/jquery/jquery.flashMessages.js