jQuery-confirm---a multipurpose plugin for alert, confirm & dialog, with Super powers.
JQuery-confirm is a jQuery plugin that provides great set of features like, Auto-close, Ajax-loading, Themes, Animations and more.
Featurers:
- Listen keyboard keys
- Directly load content via Ajax
- Auto-close dialog after a specified time
- prevent Dialog close on background click
- callback function, and ton more
More documents here
Step1:
head |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js"></script>
via Bower:
Simply copy these links
Simply copy these links
$ bower install craftpip/jquery-confirm
via Npm:
$ npm install jquery-confirm
Link bootstrap 4 if you want to apply it.
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
Link font-awesome if you want to apply in button.
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
Step2:
html |
css |
Step3:
Let's analyze js part.
alert |
confirm |
There is a question in the confirm box which can lead you to different function.When choose 'yes', the url location will target to a new href in attribute.
prompt |
button |
draggable |
loading |
setContentPrepend: show the content when the window open.
setContentAppend: add new things after 3 seconds.
columeClass: the width type of the window.