2.0.0 • Published 7 years ago

aria-notifications-generator v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

ARIA NOTIFICATIONS GENERATOR

Extremely small jQuery plugin extension for aria-notifications.js to dynamically inject notifications in the markup.

Get aria-notifications.js at https://github.com/DavideTriso/aria-notifications.

Dependencies

jQuery aria-notifications.js

Settings / Options

NameDefaultTypeDescriptionRequired or optional
notificationClassnotificationstringClass added to a notification elementoptional
boxClassnotification__boxstringClass added to a notification box elementoptional
messageClassnotification__messagestringClass added to a notification messageoptional
controlClassnotification__controlstringClass added to a notification control wrapper element (wrapper for dismiss button)optional
dismissBtnfalsefalse or stringMarkup for dismiss buttonoptional
message(not set)stringThe notification message / textRequired

Usage

  1. Include the JS script aria-notifications-generator.js - or the minified production script aria-notifications-generator.min.js- in the head or the body of your HTML file.
  2. Initialise the widget within an inline script tag, or in an external JS file.

Example

$(document).ready(function () {
  'use strict';

  //Inject a dialog in the markup
  $('#notification-wrapper').ariaNotificationGenerator({
    message: 'You have successfully logged in!'
  });

  //Initialise the dialog with aria-notifications.js
  $('.notification').ariaNotifications();

  //Show the notification
  $('#my-notification').ariaNotifications('show');

});

LICENSE

This project is licensed under the terms of the MIT license.

See LICENSE.md for detailed informations.