触发点下边与弹出层上边水平居中对齐
$('.popup1').popup({trigger:'.trigger',triggerType:'mouse',node:'ul'});
触发点右侧与弹出层左侧垂直居中对齐
$('.popup2').popup({trigger:'.trigger',triggerType:'click',node:'ul',points:['rc','lc']});
触发点与弹出层居中对齐
$('.popup3').popup({trigger:'.small',triggerType:'mouse',node:'.big',points:['cc','cc']});
$(selector).popup(options);
参数 | 默认值 | 说明 |
---|---|---|
triggerType | 'mouse' | 触发事件类型 |
trigger | '' | 触发的节点(选择器) |
node | '' | 弹出的节点(选择器) |
points | ['cb','ct'] | 弹出层与参考节点的对齐方式,t(top),b(bottom),c(center),l(left),r(right) |
offset | [0,0] | 有效值为 [n, m],points对齐后offset值,一般可用于微调,n和m分别表示对齐两个点在x,y坐标之间的偏移量 |
onTrigger | function(api){} | 弹出时触发,api接口可以控制弹层的展示(show)及隐藏(hide) |