Elegant Notice Bar With Progress Bar – notice.js
Install & download the package.
# NPM $ npm install notice.js --save
Link to the necessary JavaScript and CSS files.
<link href="noticejs.css" rel="stylesheet"> <script src="notice.js"></script>
Create a new notification instance.
const instance = new NoticeJs({
title: 'Notification title',
text: 'Notification message'
}) Show the notification on the page.
instance.show();
Set the animation type. Available types:
const instance = new NoticeJs({
title: 'Notification title',
text: 'Notification message',
type: 'error'
}) Set the position of the notification. Default: ‘topRight’.
const instance = new NoticeJs({
title: 'Notification title',
text: 'Notification message',
position: 'topLeft'
}) Set the duration of the notification. Default: 3 seconds.
const instance = new NoticeJs({
title: 'Notification title',
text: 'Notification message',
timeout: 30
}) Add extra CSS3 animations to the notification. In this example, we’re going to use Animate.css for the animations.
const instance = new NoticeJs({
title: 'Notification title',
text: 'Notification message',
animation: {
open: 'animated bounceInRight',
close: 'animated bounceOutLeft'
}
}) More configuration options.
const instance = new NoticeJs({
title: 'Notification title',
text: 'Notification message',
newestOnTop: false,
timeout: 30,
progressBar: true,
closeWith: ['button'],
modal: true,
width: 320,
scroll: {
maxHeightContent: 300,
showOnHover: true
},
rtl: false
}) Callback functions.
const instance = new NoticeJs({
title: 'Notification title',
text: 'Notification message',
callbacks: {
beforeShow: [],
onShow: [],
afterShow: [],
onClose: [],
afterClose: [],
onClick: [],
onHover: [],
onTemplate: []
}
}) v0.5.0 (11/02/2025)
The post Elegant Notice Bar With Progress Bar – notice.js appeared first on CSS Script.
INDIANAPOLIS, Ind. (WOWO) — The Indianapolis Metropolitan Planning Organization (IMPO) has announced a $48 million…
INDIANAPOLIS, Ind. (WOWO) — Forecasters are tracking an increasing chance of rain at the Indianapolis…
Spoilers of course follow for The Boys Season 5, Episode 7.With Prime Video's The Boys…
FORT WAYNE, Ind. (WOWO) — After President Trump signaled support for suspending the 18-cent federal…
INDIANAPOLIS, Ind. (WOWO) — Katherine Legge will become the first woman to try and complete…
The U.S. Capitol is pictured on March 3, 2026. (Photo by Jennifer Shutt/States Newsroom)WASHINGTON —…
This website uses cookies.