$.form_prompt_modify= function(text, title,html,onOK,onCancel) {
var config;
if (typeof text === 'object') {
config = text;
} else {
config = {
text: text,
title: title,
onOK: onOK,
onCancel: onCancel
}
}
var modal = $.modal({
text: '<p class="weui-prompt-text">'+(config.text || '')+'</p>' +html,
title: config.title,
autoClose: false,
buttons: [
{
text:'取消',
className: "default",
onClick: function () {
$.closeModal();
config.onCancel && config.onCancel.call(modal);
}
}, {
text: '确定',
className: "primary",
onClick: function() {
if(config.autoClose){
$.closeModal();
}
config.onOK && config.onOK.call(modal);
}
}]
}, function () {
$('.weui_dialog_bd input').eq(0).focus()[0].select();
});
return modal;
};
jquery weui 自定义html的promt
最新推荐文章于 2022-04-19 17:04:34 发布