📜 ⬆️ ⬇️

jQuery plugin for visual message stack

The task was to dynamically visualize the reaction to the actions of the user by the system.
In other words: some state of the object has changed - display messages about the successful completion of saving the changes in the database / system.
Writing a plugin was not long in coming ...

An example of use that shows the functionality of the plugin:
$( '#save' ).click( function () {
var msgObj = $.notify.add( " " , 3);
// ( 3 ) msgObj
$.get( 'test.txt' , function (result) {
if (result.ok) { //
$.notify.remove(msgObj, 0.5);
// 0,5 ,
$.notify.add( " " , 1);
//
} else { //
$.notify.remove(msgObj, 0.5);
// 0,5 ,
$.notify.add( " " , 'error' , 3);
// "" (css error) 3
}
}, "json" );
});


* This source code was highlighted with Source Code Highlighter .

Download jquery.notify.js

About the error, suggestions, write to the comments.

')

Source: https://habr.com/ru/post/103293/


All Articles