/*
* author: ovsexia
* version: 2.6.3
* name: Xtiper
* describe: 弹层弹窗解决方案
*/
;!function(window, undefined){
var Xclass = function(config){
var that = this;
//按钮失焦
that.loseblur();
//客户端
that.ifmob = /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent);
//主id
var rand = Math.random().toString().split('.')[1];
var mainid = 'xtiper_'+rand;
that.mainid = mainid;
//参数配置
config = that.namefix(config);
that.c = config;
var xcstr = '';
if(typeof(config.reset)!="undefined" && config.reset!==null && config.reset===false){
for(var key in config){
if(config[key]!=null){
xcstr += config[key].toString();
}
}
that.xcstr = that.xcstrRep(xcstr);
}else{
that.xcstr = xcstr;
}
//关闭
if(config.model=='close'){
that.close(config.closeid);
return false;
}
//关闭
if(config.model=='closeAll'){
that.closeAll();
return false;
}
//入口
that.creat();
};
Xclass.pt = Xclass.prototype;
//让所有按钮失去焦点
Xclass.pt.loseblur = function(){
var button = document.getElementsByTagName('button');
if(button.length>0){
for(var i=0;i';
}
html += c.tip+'
';
if(c.icon){
html += c.iconFlag===true ? '' : '';
}
html += c.tip+'
'+c.tip+'
'; }else{ html += ''+c.tip+'
'; } html += ''; } //弹窗层 else if(c.model=='win'){ if(c.type=='alert'){ c.btn = c.btn!=null ? c.btn : ['确定']; c.btn1 = 1==2 ? null : function(){return false;}; c.btn2 = null; c.btn3 = null; c.btn4 = null; }else if(c.type=='confirm'){ c.btn = c.btn!=null ? c.btn : ['确定','取消']; c.btn1 = c.btn1!=null ? c.btn1 : function(){return false;}; c.btn2 = c.btn2!=null ? c.btn2 : null; c.btn3 = c.btn3!=null ? c.btn3 : null; c.btn4 = c.btn4!=null ? c.btn4 : null; } xtiper_con_icon = c.icon ? ' xtiper_con_icon' : ''; var btnclass = new Array(); btnclass[0] = c.btn1!=null ? ' class="xactive"' : ''; btnclass[1] = c.btn2!=null ? ' class="xactive"' : ''; btnclass[2] = c.btn3!=null ? ' class="xactive"' : ''; btnclass[3] = c.btn4!=null ? ' class="xactive"' : ''; var btnfun = new Array(); btnfun[0] = c.btn1 ? c.btn1 : null; btnfun[1] = c.btn2 ? c.btn2 : null; btnfun[2] = c.btn3 ? c.btn3 : null; btnfun[3] = c.btn4 ? c.btn4 : null; that.btnfun = btnfun; if(c.maxWidth){ c.width = that.maxSize(c.width,c.maxWidth); } if(c.shade===true){ html += ''; } html += ''+c.title+'
'+(xhref ? '' : '')+''+(xhref ? '' : '')+(i==xindex && that.ifmob===true ? '' : '')+'
'+c.title+'
'+c.btn[i]+'
'; } }else{ licon = ''+c.btn[i]+'
'; } html += ''+c.btnClose+'