layer是当下很受欢迎的一个前端弹出框插件,layer同时提供了放大、缩小、还原的回调函数。那如何在放大、缩小、还原时触发对应的回调函数呢,可以通过layer提供的
min()、full()、restore()回调方法来实现
实现代码:
layer.open({
type: 2,
content: "test.html",
maxmin:true,
min: function() { //点击最小化后的回调函数
alert('点击最小化时触发回调函数');
},
full: function() { //点击最大化后的回调函数
alert('点击最大化时触发回调函数');
},
restore: function() { //点击还原后的回调函数
alert('点击还原时触发回调函数。');
}
})