🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

nok.js is a cross-browser, extra-light (1kb minified) jQuery notification plugin to create toast- or growl-like info/success/error notifications on the screen.

Notification toast-message growl-notification

Documentation

jquery.nok

Yet another full-fledged jQuery notification plugin with bare minimum code. 931 bytes only (616 bytes : js, 315 bytes : css

Dependency

Ofcourse, jQuery library. Make sure it is included, else do that first.

Instalation

Include jquery.nok.min.css from dist folder.

<link rel="stylesheet" href="./dist/jquery.nok.min.css">

Include jquery.nok.min.js from dist folder.

<script src="./dist/jquery.nok.min.js"></script>

Thats all. Ready to use.

npm? npm install jquery.nok

Fire a nok

$.nok({message: "Knock Knock, anyone home?"});

Customize?

$.nok({     message: "OOpSEE!! Mishap!",     type: "error",     stay: 0 // Sticky });

Options

        message: '',    // The message to display         type: 'info',   // Type of message : info / error / success         sticky: false,  // Stay or hide after sometimes, bool : DEPRECATED (will be removed in future version)         stay: 4         // Seconds the message stays (since v.1.1.0 set this value to 0 to make sticky) 

Note

  • Values included under Options are defaults. Change those as required.
  • If message is blank, nok will not knock (appear).
  • Pass a second value in number only else the nok will be sticky.
  • Click on a sticky nok to dismiss. Simple as that.

Version History:

1.1.0 : <2018.08.20>

  • Deprecate option sticky, replaced by {stay: 0}

1.0.1 : <2018.08.20>

  • Added SASS Partial
  • Code Cleanup

1.0.0 : <2018.01.20>

  • Initial Stable Release

You May Also Like