Minimalist Flat Confirmation Dialog Plugin With jQuery confirm js - Download Minimalist Flat Confirmation Dialog Plugin With jQuery - confirm.js

Download Minimalist Flat Confirmation Dialog Plugin With jQuery – confirm.js

Posted on

This time I will share jQuery Plugin and tutorial about Minimalist Flat Confirmation Dialog Plugin With jQuery – confirm.js, hope it will help you in programming stack.

Minimalist Flat Confirmation Dialog Plugin With jQuery confirm js - Download Minimalist Flat Confirmation Dialog Plugin With jQuery - confirm.js
File Size: 3.95 KB
Views Total: 2720
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

confirm.js is a super tiny jQuery plugin for making a flat style dialog box to confirm some actions with an ‘Accept’ callback and custom text messages.

How to use it:

1. Load the required style sheet in your document’s head section.

1 <link rel="stylesheet" href="jquery.confirm.css">

2. Load jQuery library and the jQuery confirm.js script style just before the closing body tag.

1 <script src="//code.jquery.com/jquery.min.js"></script>
2 <script src="jquery.confirm.js"></script>

3. Display a confirmation dialog on the webpage.

1 $.confirm({
2   'title'         : 'Are you sure?',
3   'acceptTitle'   : 'Yes',
4   'rejectTitle' : 'No',
5   'acceptAction'  : function() {alert('You clicked YES');}
6 });

4. Override or change the CSS as shown below to create your own styles.

01 .confirm<a href="https://www.jqueryscript.net/tags.php?/Modal/">Modal</a> {
02   position: fixed;
03   top: 0;
04   right: 0;
05   bottom: 0;
06   left: 0;
07   z-index: 1040;
08   background-color: #000;
09   opacity: .5;
10 }
11  
12 .confirmBox {
13   cursor: default;
14   position: fixed;
15   top: 0;
16   right: 0;
17   bottom: 0;
18   left: 0;
19   z-index: 1050;
20   overflow: hidden;
21   -webkit-overflow-scrolling: touch;
22   outline: 0;
23   user-select: none;
24   -moz-user-select: none;
25   -webkit-user-select: none;
26   -ms-user-select: none;
27 }
28  
29 .confirmBox .confirmDialog {
30   transform: translate(0, 0);
31   width: 400px;
32   margin: 10% auto;
33   position: relative;
34 }
35  
36 .confirmBox .confirmContent {
37   -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
38   box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
39   position: relative;
40   background-color: #fff;
41   -webkit-background-clip: padding-box;
42   background-clip: padding-box;
43   outline: 0;
44   font-size: 24px;
45   border-radius: .20em;
46   font-family: sans-serif;
47 }
48  
49 .confirmBox .confirmTitle {
50   padding: 35px 30px;
51   color: #000;
52   margin: 0;
53 }
54  
55 .confirmBox .button {
56   box-sizing: border-box;
57   cursor: pointer;
58   display: inline-block;
59   color: #fff;
60   width: 50%;
61   position: relative;
62   padding: 25px;
63   text-align: center;
64 }
65  
66 .confirmBox .accept {
67   background-color: #69FC96;
68   border-radius: 0 0 0 .20em;
69 }
70  
71 .confirmBox .accept:hover { background-color: #87FFAC; }
72  
73 .confirmBox .reject {
74   background-color: #fc7169;
75   border-radius: 0 0 .20em 0;
76 }
77  
78 .confirmBox .reject:hover { background-color: #fc8982; }

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

source : jqueryscript.net