我试图给出一些风格的消息框,弹出后按下注销按钮(只是确认窗口)。为此我的jQuery代码:造型消息框
$(document).ready(function() {
$("a[data-post]").click(function (e) {
e.preventDefault();
var $this = $(this);
var message = $this.data("post");
if (message && !confirm(message)) {
return;
}
$("<form>")
.attr("method", "post")
.attr("action", $this.attr("href"))
.appendTo(document.body)
.submit();
});
});
_layout部分:
<a href="@Url.RouteUrl("Logout")" data-post="Are you sure you want to Logout?"><div class="navFont">Logout</div></a>
问题林不知道如何调用该消息框在CSS文件给它一些风格。
“确认”对话框默认为浏览器。这些不能使用CSS进行修改。你可以看看像[jQuery对话框](https://jqueryui.com/dialog/) – Pugazh
这样的选项我怎样才能让它不是默认的? – Kelb56
请参阅此SO帖子http://stackoverflow.com/questions/6185152/how-to-style-default-confirm-box-with-only-css – Pugazh