Roh*_*han 1 javascript jquery smartadmin
我正在使用Smart Admin主题,特别是Ajax版本.当我按下右上角的注销按钮时,它会显示一条很好的警报确认消息.
我试着看看如何在其他请求中使用它?例如,如果有人要删除重要资源,我希望他们能够看到它.但我不确定主题制作者是否已经给出了触发这一点的方法.
我知道它data-attributes与之相关:
data-logout-msg="You can improve your security further after logging out by closing this opened browser"
Run Code Online (Sandbox Code Playgroud)
但我不知道如何在我的应用程序中的另一个链接上使用它.任何想法的人?我可以在哪里调用API方法吗?
小智 7
$("#smart-mod-eg1").click(function(e) {
$.SmartMessageBox({
title : "Smart Alert!",
content : "This is a confirmation box. Can be programmed for button callback",
buttons : '[No][Yes]'
}, function(ButtonPressed) {
if (ButtonPressed === "Yes") {
$.smallBox({
title : "Callback function",
content : " You pressed Yes...",
color : "#659265",
iconSmall : "fa fa-check fa-2x fadeInRight animated",
timeout : 4000
});
}
if (ButtonPressed === "No") {
$.smallBox({
title : "Callback function",
content : " You pressed No...",
color : "#C46A69",
iconSmall : "fa fa-times fa-2x fadeInRight animated",
timeout : 4000
});
}
});
e.preventDefault();
})