在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:myclabs/jquery.confirm开源软件地址:https://github.com/myclabs/jquery.confirm开源编程语言:JavaScript 47.1%开源软件介绍:jquery.confirmConfirm dialogs for buttons and links. This library is not maintained. Looking for a maintainer, please open an issue Requirements
If you use Bootstrap 2, you can use any 1.x version. From 2.0 and onwards, Bootstrap 3 is required. InstallationThe library can be downloaded manually or installed with Bower:
Or npm:
Usage<a href="home" class="confirm">Go to home</a> $(".confirm").confirm(); Any click on the link will pop up a dialog asking the user to confirm the action. OptionsList of the options:
Example: <button class="confirm" type="button">Delete the comment</button> $(".confirm").confirm({
text: "Are you sure you want to delete that comment?",
title: "Confirmation required",
confirm: function(button) {
delete();
},
cancel: function(button) {
// nothing to do
},
confirmButton: "Yes I am",
cancelButton: "No",
post: true,
confirmButtonClass: "btn-danger",
cancelButtonClass: "btn-default",
dialogClass: "modal-dialog modal-lg" // Bootstrap classes for large modal
}); You can also use <button class="confirm" type="button"
data-text="Do you really want to delete that comment?"
data-confirm-button="Yes I am"
data-cancel-button="Whoops no">
Delete the user
</button> $(".confirm").confirm(); Manual triggeringYou can manually trigger the confirmation dialog: // Will immediately show the confirmation popup
$.confirm({
text: "Are you sure you want to delete that comment?",
confirm: function() {
delete();
},
cancel: function() {
// nothing to do
}
}); Remember that if you trigger the confirmation dialog manually, you must provide a Global configurationYou can configure some options globally, for example if you translate the messages: $.confirm.options = {
text: "Are you sure?",
title: "",
confirmButton: "Yes",
cancelButton: "Cancel",
post: false,
submitForm: false,
confirmButtonClass: "btn-warning",
cancelButtonClass: "btn-default",
dialogClass: "modal-dialog"
} ContributingPull requests and bug reports are welcome! Be aware that you do not need to generate the minified version yourself, it will be generated by a release manager (for security reasons). Change logLicenseThis software is released under the MIT license. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论