Okay
  Public Ticket #852601
how to use flash notification
Closed

Comments

  • Aldhi started the conversation

    hi, 

    how to use flash notification, like this picture

  • [deleted] replied

    Hi Aldhi,

    In order to use Toastr notifications you need to include this library:

    <script src="assets/js/toastr.js"></script>

    Then to show it in the page, you can use this way:

    toastr.success( 'Your message here...', opts );
    

    An example of that is here:

    <script type="text/javascript">
    jQuery(document).ready(function($)
    {
    // Sample Toastr Notification
    setTimeout(function()
    {
    var opts = {
    "closeButton" : true,
    "debug" : false,
    "positionClass" : "toast-top-right",
    "toastClass" : "black",
    "onclick" : null,
    "showDuration" : "300",
    "hideDuration" : "1000",
    "timeOut" : "5000",
    "extendedTimeOut" : "1000",
    "showEasing" : "swing",
    "hideEasing" : "linear",
    "showMethod" : "fadeIn",
    "hideMethod" : "fadeOut"
    };

    toastr.success("You have been awarded with 1 year free subscription. Enjoy it!", "Account Subcription Updated", opts);
    }, 3000);
    });
    </script>
    This will show the notification 3 seconds after page loads.