Sliding Confirm Dialog Plugin with jQuery Bootstrap Confirm - Download Sliding Confirm Dialog Plugin with jQuery and Bootstrap - Confirm

Download Sliding Confirm Dialog Plugin with jQuery and Bootstrap – Confirm

Posted on

This time I will share jQuery Plugin and tutorial about Sliding Confirm Dialog Plugin with jQuery and Bootstrap – Confirm, hope it will help you in programming stack.

Sliding Confirm Dialog Plugin with jQuery Bootstrap Confirm - Download Sliding Confirm Dialog Plugin with jQuery and Bootstrap - Confirm
File Size: 367 KB
Views Total: 2850
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Confirm is a jQuery plugin used to popups an animated and heavily customizable confirm dialog box styled with Bootstrap modal component.

How to use it:

1. Include jQuery library, Bootstrap 3 framework and the jQuery confirm plugin in the document. 

1 <link href="//netdna.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
2  
3 <script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
4 <script src="jquery.confirm.js"></script>
5 <script src="//netdna.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>

2. Create a link or button to trigger a confirm dialog.

1 <a id="demo" href="http://www.google.com">Click me</a>

3. Call the plugin with default options to trigger a simple confirm dialog box sliding from the top of the web page. Once you click on the ‘Yes’ button, the current page will go to the URL specified in the href attribute.

1 $("#demo").confirm();

4. Customize the confirm dialog via JS.

01 $("#demo").confirm({
02  
03   // Title of the confirm dialog
04   title:"Delete confirmation",
05  
06   // Text to display in the confirm dialog
07   text:"Are you really really sure?",
08  
09   // Handler executed when the user confirms
10   confirm: function(button) {
11     alert("You just confirmed.");
12   },
13  
14   // Handler executed when the user cancels
15   cancel: function(button) {
16     alert("You aborted the operation.");
17   },
18  
19   // Label of the confirm button
20   confirmButton: "Yes",
21  
22   // Label of the cancel button
23   cancelButton: "No"
24  
25 });

5. Customize the confirm dialog via Html5 data-* attributes.

1 <a id="demo" href="http://www.google.com"
2    data-title="Hello there!"
3    data-confirm-button="Yes">
4    Click me
5 </a>
6  
7 $("#demo").confirm();

Change logs:

2016-11-01

  • Change options overriding order.

2016-10-02

  • Fix submitForm options behaviour

2016-04-14

  • use closest to find form

2015-03-20

2014-12-20

  • add a cancelButtonClass option which allows to add custom cancel button class

This awesome jQuery plugin is developed by myclabs. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net