标签:document tle oda on() click ack confirm cpi order
/** * 提示框 * @param content 必须,提示内容 * @param title 默认为“提示”,可不传 * @param onClose 关闭提示框后执行的函数function,可不传 */ cpic.alert=function(content, title, onClose) { $("#xybx-alert-dialog",window.parent.document).remove(); var dialog = ‘<div id="xybx-alert-dialog" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" style="width:25%;">‘ + ‘<div class="modal-header bottom-border">‘ + ‘<h4 style="text-align: center;">‘ + (cpic.isNull(title)?"提示":title) + ‘</h4>‘ + ‘</div>‘ + ‘<div class="modal-body" style="text-align: center;min-height:60px;">‘ + content + ‘</div>‘ + ‘<div class="control-div">‘ + ‘<button id="xybx-alert-dialog-confirm" data-dismiss="modal" aria-hidden="true" class="btn btn-primary alert-dialog-ok">确认</button>‘ + ‘</div>‘ + ‘</div>‘; $(window.parent.document.body).append(dialog); $("#xybx-alert-dialog",window.parent.document).modal({}); $("#xybx-alert-dialog .alert-dialog-ok",window.parent.document).click(function(){ $("#xybx-alert-dialog",window.parent.document).modal(‘hide‘); if(onClose) { setTimeout(onClose,510); } }); }; /**** * confirm提示框 * @param msg 消息提示内容 * @param onOk 确定后回调函数 * @param onCancel 取消后回调函数 */ cpic.confirm=function(msg, onOk, onCancel) { $("#xybx-confirm-dialog",window.parent.document).remove(); var dialog = ‘<div id="xybx-confirm-dialog" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" style="width:25%;">‘ + ‘<div class="modal-header bottom-border">‘ + ‘<h4 style="text-align: center;">提示</h4>‘ + ‘</div>‘ + ‘<div class="modal-body" style="text-align: center;min-height:60px;">‘ + msg + ‘</div>‘ + ‘<div class="control-div">‘ + ‘<button id="xybx-confirm-dialog-ok" data-dismiss="modal" aria-hidden="true" class="btn btn-primary confirm-dialog-ok">确认</button>‘ + ‘<button id="xybx-confirm-dialog-cancel" data-dismiss="modal" aria-hidden="true" class="btn confirm-dialog-cancel">取消</button>‘ + ‘</div>‘ + ‘</div>‘; $(window.parent.document.body).append(dialog); $("#xybx-confirm-dialog",window.parent.document).modal({}); $("#xybx-confirm-dialog #xybx-confirm-dialog-ok",window.parent.document).click(function(){ $("#xybx-confirm-dialog",window.parent.document).modal(‘hide‘); if(onOk) { setTimeout(onOk,510); } }); $("#xybx-confirm-dialog #xybx-confirm-dialog-cancel",window.parent.document).click(function(){ $("#xybx-confirm-dialog",window.parent.document).modal(‘hide‘); if(onCancel) { setTimeout(onCancel,510); } }); };
标签:document tle oda on() click ack confirm cpi order
原文地址:https://www.cnblogs.com/jiangaihu/p/14480745.html