jquery重写实现confirm功能
写个函数实现confirm,要改样式,改函数名为Confirm,下面是我写的函数,但是不行,大家帮忙看看是什么问题
function Confirm(msg)
{
var alertFram = document.createElement("div");
$(alertFram).attr('id', 'confirmFram');
$(alertFram).attr('class', 'alert alert-block');
$(alertFram).width('300px');
$(alertFram).height('100px');
$(alertFram).css({
"position":"absolute",
"left":"40%",
"top":"30%",
"margin-left":"-75px",
"text-align":"center",
"line-height":"50px",
});
strHtml = ' <h4 class="alert-heading">警告!</h4>';
strHtml += msg;
strHtml += "<p> <input type=\"button\" class=\"btn btn-danger\" value=\"确 定\" onclick=\"ok()\" />";
strHtml += " <input type=\"button\" class=\"btn btn-danger\" value=\"取消\" onclick=\"cancel()\" />";
$(alertFram).html(strHtml);
$('body').append(alertFram);
this.ok = function()
{
$(alertFram).hide();
return true;
}
this.cancel = function()
{
$(alertFram).hide();
return false;
}
return false;
}
有会的朋友帮帮忙吧
function Confirm(msg)
{
var alertFram = document.createElement("div");
$(alertFram).attr('id', 'confirmFram');
$(alertFram).attr('class', 'alert alert-block');
$(alertFram).width('300px');
$(alertFram).height('100px');
$(alertFram).css({
"position":"absolute",
"left":"40%",
"top":"30%",
"margin-left":"-75px",
"text-align":"center",
"line-height":"50px",
});
strHtml = ' <h4 class="alert-heading">警告!</h4>';
strHtml += msg;
strHtml += "<p> <input type=\"button\" class=\"btn btn-danger\" value=\"确 定\" onclick=\"ok()\" />";
strHtml += " <input type=\"button\" class=\"btn btn-danger\" value=\"取消\" onclick=\"cancel()\" />";
$(alertFram).html(strHtml);
$('body').append(alertFram);
this.ok = function()
{
$(alertFram).hide();
return true;
}
this.cancel = function()
{
$(alertFram).hide();
return false;
}
return false;
}
有会的朋友帮帮忙吧
...全文
相关推荐
Rad Confirm 阻塞
关于 Telerik Conterls 重写 Rad Confirm 实现阻塞
jquery-confirm设置按钮显示中文
博客地址:http://blog.csdn.net/guoqianqian5812/article/details/74295865
jQuery自定义简单清爽的confirm确认对话框效果
jQuery自定义简单清爽的confirm确认对话框效果
jquery封装的漂亮弹窗confirm
这个基于jQuery的弹窗组件拥有漂亮的外观,良好的兼容性和易用性。
jquery-confirm按钮显示中文
jquery-confirm显示中文按钮,确定取消是否等等,很好用。


