layer.msg(msg,time,parme)设置图标问题layer.msg只提到3个参数,实际上有第4个参数,第4个参数就是msg关闭后执⾏的回调。
layer.msg('提⽰', 2, 1, function(){})
第⼀个参数:提⽰
第⼆个参数:⾃动关闭时间
第三个参数:图标类型
第四个参数:msg关闭后执⾏的回调
layer.msg() 和 layer.alert() 结合使⽤后的问题
在layer.msg() 弹出错误提⽰后,提交后弹出 layer.alert() 提⽰点确定关闭ifram 却关闭不了。
点击确定,关闭不了最外层的ifran
<script>
$.layer({
type : 2,
shade :false,
border:[2,0.3,'#000',true],
title : '问卷试题',
iframe : {src : 'wj.aspx'},
area : ['750px' , '500px'],
offset : ['100px','']
});
</script>
ifram页⾯
iframe参数传递
msg 事件
if ($("#ValidCode").val() == "") {
layer.msg('请输⼊验证码!', 1, {
shade: false
});
$("#ValidCode").focus();
return false;
}
layer.alert('恭喜您提交成功,本次测试分数:' + data.cj + '分!', 1, '信息',
function(index) {
parent.layer.close(index);
});