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
Name | Default | Type | Description | Required or optional |
---|---|---|---|---|
notificationClass | notification | string | Class added to a notification element | optional |
boxClass | notification__box | string | Class added to a notification box element | optional |
messageClass | notification__message | string | Class added to a notification message | optional |
controlClass | notification__control | string | Class added to a notification control wrapper element (wrapper for dismiss button) | optional |
dismissBtn | false | false or string | Markup for dismiss button | optional |
message | (not set) | string | The notification message / text | Required |
Usage
- 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.
- 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.