jQuery Flash Message Box to Show Notifications

The flashy.js is a lightweight, cross platform and general purpose flash message plugin for jQuery. It is useful to show flasher / alert (success, warning, info etc.) notifications on different JavaScript / jQuery events. The plugin comes with cool configuration options to fully customize the alert message box according to yours needs. It also supports Animate CSS library for various animations and Font Awesome for icons.

Moreover, the notification message box can be closed with iconic close button and with Esc key. However, you can also set time to automatically disappear.

Plugin Overview

Plugin: Flashy
Author: Chris
Licence: MIT Licence
Published: January 17, 2024
Repository: Fork on GitHub
Dependencies: jQuery 1.3.1 or Latest version and Font Awesome 4
File Type: zip archive (HTML, CSS & JavaScript )
Package Size: 10.8 KB

How to Use jQuery Flash Message Plugin

1. To getting started with flashy.js, first of all load jQuery and Font Awesome CSS into your HTML page.

<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>

<!-- Font Awesome 4-->
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

2. After that, also include Flashy‘s CSS and JavaScript file into your HTML document.

<!-- Flashy CSS -->
<link rel="stylesheet" type="text/css" href="css/flashy.min.css">

<!-- Flashy JS -->
<script src="js/flashy.min.js"></script>

3. Create DOM element (like a button) that will be used to trigger the flash message notification.

<button class="btn"> Test s</button>

4. Finally, define your flash message in plugin’s configuration and initialize it in jQuery document ready function.

$(document).ready(function(){

   $(".btn").click(function(){
      flashy('This is example of flash message.', {
          type : 'flashy__success'
      });

   });

});

5. To use custom animation from Animate CSS library.

 flashy('Hello I'm flashy', {
    animatedIn: 'animated bounceInRight',
    animatedOut: 'animated bounceOutRight',
 });

6. To change Font Awesome icon.

 flashy('Hello I'm flashy', {
   icon: '<i class="fa fa-close"> </i>
 });

7. To set auto close time.

flashy('Hello I'm flashy', {
   timeout: 5000, 
 });

Leave a Comment

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

About CodeHim

Free Web Design Code & Scripts - CodeHim is one of the BEST developer websites that provide web designers and developers with a simple way to preview and download a variety of free code & scripts. All codes published on CodeHim are open source, distributed under OSD-compliant license which grants all the rights to use, study, change and share the software in modified and unmodified form. Before publishing, we test and review each code snippet to avoid errors, but we cannot warrant the full correctness of all content. All trademarks, trade names, logos, and icons are the property of their respective owners... find out more...

Please Rel0ad/PressF5 this page if you can't click the download/preview link

X