layer.js 弹出层
概述
js
/*
href -> #op1
data-title -> 标题
data-width -> 宽度
data-close -> 关闭按钮
data-skin -> 样式名
*/
$('.js-btn-pop').click(function(){
href=$(this).attr('href');
tit2=$(href).attr('data-title');
if(tit2){
tit=tit2;
wh=$(href).attr('data-width');
cc=$(href).attr('data-close');
sk=$(href).attr('data-skin');
}
else
{
tit=$(this).attr('title');
wh=$(this).attr('data-width');
cc=$(this).attr('data-close');
sk=$(this).attr('data-skin');
}
if(!wh) wh=400;
if(!tit) tit='';
if(cc=='false'){
cc=false;
} else{
cc=1;
}
if(sk=='layer2'){
sk='layer1 layer2';
} else{
sk='layer1';
}
layer.open({
type: 1,
title: tit,
area:wh+'px',
shadeClose: true,
closeBtn: cc,
skin: sk,
content:$(href),
fix: false
});
return false;
});
为代码疯狂!
浙公网安备 33010602011771号