Biblioteca JavaScript de notificaciones Push a nivel de página: notificaciones de página
| Autor: | rafalm99 |
|---|---|
| Views Total: | 69 |
| Sitio oficial: | Ir a la web |
| Actualizado: | April 10, 2019 |
| Licencia: | MIT |
Vista prévia
Descripción
A vanilla JavaScript plugin to create page-level notifications similar to the web push notification.
Características
- 2 temas: oscuro y ligero.
- 4 tipos de notificación: información, éxito, ADVERTENCIA, error.
- Notificación temporal con temporizador de cuenta regresiva.
- Auto restablece la cuenta regresiva al desplazar el mouse.
Funcionamiento
Coloque el archivo JavaScript Page-notifications. js y StyleSheet Page-notifications. CSS en el HTML.
<link rel="stylesheet" href="page-notifications.css"> <script src="page-notifications.js"></script>
Inicializar las notificaciones de página.
var notifications = new PageNotifications()
Cree las notificaciones. Parámetros posibles:
title: título de notificación
contenido: mensaje de notificación
tipo: info, éxito, ADVERTENCIA o error
Duration: timeout en milisegundos. establece en false para que la notificación sea STICKY.
notifications.push(title,content,type,duration);
Utilice el tema oscuro en su lugar.
var notifications = new PageNotifications({
theme: 'dark'
}) Establezca el contenedor principal. Por defecto: todo el cuerpo.
var notifications = new PageNotifications({
parentDiv: 'container'
}) Cierre todas las notificaciones.
notifications.closeAll();





