naranja.js — -4 modes of notification box with Javascript

YvonneDev
2 min readSep 25, 2018

--

Photo by Jamie Street on Unsplash

Official Github here
The plugin of Javascript is a notification box that has four kinds of modes, such as success, error, warn, and normal.

Step1:
link style and script files

Step2:
JS

I applied four modes in one notification.

The description of options is below:

naranja().log({

title: 'Notification Title', // <- required

text: 'Here goes a description for notifiaction', // <- required

icon: true or false, // <- unrequired, default true,

timeout: 2000 or 'keep', // <- unrequired, default 3000 miliseconds

buttons: [

{

text: 'OK',

click: function (e) {

// click event close notifiaction

// unless you use preventClose method

e.preventClose()

// if you want close notifiaction

// manually, use closeNotification

e.closeNotification()

}

},

{

text: 'Cancel',

click: function () {

// make something here...

// you can (but you should not)

// add infinity buttons

}

}

]

})

Step3:
CSS

I’d like a bigger font size here. My learning Github here

👉Follow me for more useful web development content! love sharing🥰

--

--

YvonneDev
YvonneDev

Written by YvonneDev

❤️Front-end Web Development self-taught *share what I learned*

No responses yet