layer({
type:1, //display text content, 1 is html content
title:"tip",
area:["300px","200px"], //set the width and height of the popup window
content: //popup box The content of
btn:["OK","Cancel"], //set the button
yes:function(){} ,//the first button
btn2:function(){}, //the second button
concal: // Click to close
})
key: value |
describe |
The properties in the table below are all default values, you can reconfigure them when you call them, they can help you achieve various styles. Call it: $.layer({key: value, key: value, …}); |
|
type: 0 |
Type of layer. 0: info box (default), 1: page layer, 2: iframe layer, 3: loading layer, 4: tips layer. This is an important parameter. The total switch of different types of layers does not need to be configured if it is type: 0, and other types of layers must set type when calling. |
title: 'Information' |
Controls the default title bar. |
maxmin: false |
Whether to output window minimize/fullscreen/restore buttons. |
offset: ['', ''] |
Control layer coordinates. |
area: ['310px', '130px'] |
Control layer width and height. |
border: [10, 0.3, '#000'] |
Controls the border of the layer. |
shade: [0.5, '#000'] |
Control mask. |
shadeClose: false |
Used to control whether clicking on the mask area closes the layer. |
closeBtn: [0, true] |
The close button in the upper right corner of the control layer. |
time: 0 |
自动关闭等待秒数,整数值。 |
fix: true, |
用于设定层是否不随滚动条而滚动,固定在可视区域。 |
move: '.xubox_title' |
设定某个元素来实现对层的拖拽。 |
moveOut: false |
用于控制层是否允许被拖出可视窗口外 |
moveType: 0 |
用于配置拖拽类型(layer1.7之前版本不支持) |
bgcolor: '#fff' |
用于控制层的背景色 |
zIndex: 19891014 |
控制层堆叠顺序(即css的z-index)。整数值。 |
maxWidth: 400 |
最大宽度。整数值。 |
fadeIn: 300, |
用于控制层渐显弹出(layer1.7之前版本不支持) |
btns: 1, |
按钮的个数。提供了0-2的选择,设置0表示不输出按钮 |
btn: ['确定', '取消'], |
[按钮一的文本值 , 按钮二的文本值] |
shift: '', |
用于控制动画弹出 |
dialog: { type: 3, msg: '' }
|
信息框层模式提供的私有参数。使用时,按需配置即可 |
page: { dom: '#id', html: '', url: '', ok: function(datas){} }
|
页面层模式私有参数。 |
iframe: { src: '', scrolling: 'auto' }
|
iframe层模式私有参数。 |
loading: { type: 0 }
|
加载层私有属性。 |
tips : { msg: '', follow: '#id', guide: 0, isGuide: true, more: false, style: ['', ''] }
|
tips提示层私有属性。 |
回调函数 |
|
success: function(layero){
}
|
层弹出成功后的回调函数. |
yes: function(index){}
|
按钮一的回调函数 |
no: function(index){}
|
按钮二的回调函数 |
close: function(index){}
|
层右上角关闭按钮的点击事件触发回调函数。 |
end: function(){}
|
层被彻底关闭后执行的回调函数。 |
moveEnd: function(){}
|
拖拽完毕触发的回调函数 |
min: function(layero){}, full: function(layero){}, restore: function(layero){}
|
分别为最小化、全屏、还原触发后的回调函数 |