Small JavaScript Alert & Confirm Dialog Replacement – Custom Alert

Category: Javascript , Modal & Popup | April 21, 2017
Author: PhilippeAssis
Views Total: 12,069
Official Page: Go to website
Last Update: April 21, 2017
License: MIT

Preview:

Small JavaScript Alert & Confirm Dialog Replacement – Custom Alert

Description:

custom-alert is a lightweight JavaScript alternative to default alert() and confirm() dialog boxes that make them easy to customize via CSS and JavaScript.

How to use it:

Load the customAlerts.css for default styles.

<link href="css/customAlerts.css" rel="stylesheet">

Load the customAlerts.js anywhere on your web page.

<script src="js/customAlerts.js"></script>

Create an alert box.

alert('I'm an alert box',{
  title : 'Alert Title',
  ok : 'Okey'
})

Create a confirm box.

confirm(
  'I'm a confirm box',
  function(data){
    console.log('Exemplo: '+data)
  },
  {
    return : true
    title : 'Comfirm Title',
    yes : 'Okey',
    no : 'No!'
  }
)

Changelog:

04/21/2017

  • Fix for keyboard input blocked and customConfirm title config

You Might Be Interested In:


Leave a Reply