admin管理员组文章数量:1026989
I want to use a confirm dialog that looks better than the one produced by the build-in JavaScript confirm()
method.
I have tried Toastr but found that the confirm
functionality was a bit tricky to achieve with No/Yes buttons. It has to still be maintained and updated.
Thanks for all suggestion!
I want to use a confirm dialog that looks better than the one produced by the build-in JavaScript confirm()
method.
I have tried Toastr but found that the confirm
functionality was a bit tricky to achieve with No/Yes buttons. It has to still be maintained and updated.
Thanks for all suggestion!
Share Improve this question edited May 8, 2020 at 11:04 codebod 6846 silver badges17 bronze badges asked Dec 20, 2017 at 8:37 AllramEstAllramEst 1,4594 gold badges28 silver badges55 bronze badges 2- I use this along with toastr craftpip.github.io/jquery-confirm – Sanal S Commented Dec 20, 2017 at 8:45
- super. Was just browsing on that page – AllramEst Commented Dec 20, 2017 at 8:46
2 Answers
Reset to default 3I think that one of the most beautiful API out there is SweetAlert2.
You can set up your dialogs as follows:
swal({
title: 'Are you sure?',
text: "You won't be able to revert this!",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.value) {
swal(
'Deleted!',
'Your file has been deleted.',
'success'
)
}
})
This is how it looks like:
You can even customize the CSS to adapt it to your project colors.
Hope this helps!
Try jquery-confirm. They have a variety of designs.
I want to use a confirm dialog that looks better than the one produced by the build-in JavaScript confirm()
method.
I have tried Toastr but found that the confirm
functionality was a bit tricky to achieve with No/Yes buttons. It has to still be maintained and updated.
Thanks for all suggestion!
I want to use a confirm dialog that looks better than the one produced by the build-in JavaScript confirm()
method.
I have tried Toastr but found that the confirm
functionality was a bit tricky to achieve with No/Yes buttons. It has to still be maintained and updated.
Thanks for all suggestion!
Share Improve this question edited May 8, 2020 at 11:04 codebod 6846 silver badges17 bronze badges asked Dec 20, 2017 at 8:37 AllramEstAllramEst 1,4594 gold badges28 silver badges55 bronze badges 2- I use this along with toastr craftpip.github.io/jquery-confirm – Sanal S Commented Dec 20, 2017 at 8:45
- super. Was just browsing on that page – AllramEst Commented Dec 20, 2017 at 8:46
2 Answers
Reset to default 3I think that one of the most beautiful API out there is SweetAlert2.
You can set up your dialogs as follows:
swal({
title: 'Are you sure?',
text: "You won't be able to revert this!",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.value) {
swal(
'Deleted!',
'Your file has been deleted.',
'success'
)
}
})
This is how it looks like:
You can even customize the CSS to adapt it to your project colors.
Hope this helps!
Try jquery-confirm. They have a variety of designs.
本文标签: jqueryBest confirm dialog JavaScript libraryStack Overflow
版权声明:本文标题:jquery - Best confirm dialog JavaScript library - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745568549a2156596.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论