JavaScript

超轻量级php框架startmvc

LayerClose弹窗关闭刷新方法

更新时间:2020-07-21 19:00:01 作者:startmvc
//LayerClose弹窗关闭varLayerClose=function(type){console.log(type);if(typeoftype=="undefined"){return;}//开始判

//LayerClose弹窗关闭


var LayerClose = function(type){
console.log(type);
 if(typeof type =="undefined"){
 return;
 }
 
 // 开始判断
 switch(type){
 case "self":
 var index = layer.index
 layer.close(index);
 break;
 case "FrameIndex":
 var index = parent.layer.getFrameIndex(window.name);
 layer.close(index);
 break;
 case "selfall":
 layer.closeAll(); //疯狂模式,关闭所有层
 break;
 case "fatherall":
 parent.layer.closeAll(); //疯狂模式,关闭所有层
 break;
 default:
 
 break;
 }
};

var LayerClose2= function(index,type){
 
 if(typeof type =="undefined"){
 return;
 }
 
 // 开始判断
 
 switch(type){
 case "tips":
 layer.closeAll('tips'); //关闭所有的tips层
 break;
 case "loading":
 layer.closeAll('loading');
 break;
 case "iframe":
 layer.closeAll('iframe');
 break;
 case "dialog":
 layer.closeAll('dialog');
 break;
 case "page":
 layer.closeAll('page');
 break;
 default:
 
 break;
 }
 
 
 
};

var LayerClose3 = function(o){
console.log(o.type);
 if(typeof o.type =="undefined"){
 return;
 }
 
 // 开始判断
 switch(o.type){
 case "self":
 (!o.index)?layer.index:o.index
 layer.close(o.index);
 break;
 case "FrameIndex":
 //var index = parent.layer.getFrameIndex(window.name);
 (!o.index)?parent.layer.getFrameIndex(window.name):o.index
 layer.close(o.index);
 break;
 case "selfall":
 layer.closeAll(); //疯狂模式,关闭所有层
 break;
 case "fatherall":
 parent.layer.closeAll(); //疯狂模式,关闭所有层
 break;
 default:
 
 break;
 }
};

// 关闭刷新


var layerReload = function(index,type){
 
 if(typeof index =="undefined"||typeof type =="undefined"){
 return;
 }
 
 // 开始判断
 
 switch(type){
 case "topreload":
 parent.window.location.reload();
 break;
 case "reload":
 window.location.reload();
 break;
 case "no":
 Layerclose("FrameIndex");//关闭弹窗
 // window.location.reload();
 break;
 case "refreshTable":
 Layerclose("FrameIndex");
 $('#tablelist').bootstrapTable('refresh');
 break;
 
 default:
 break;
 }
 
 
 
}

以上这篇LayerClose弹窗关闭刷新方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

LayerClose 弹窗 关闭 刷新