1,本彈窗直接跳轉父頁面:
1 @if(session('message')) 2 3 <script> 4 window.parent.location.reload(); //刷新父頁面 5 var index = parent.layer.getFrameIndex(window.name); //獲取窗口索引 6 parent.layer.close(index); // 關閉layer 7 </script> 8 @endif
2,點擊關閉彈窗后刷新當前頁面:
只需在彈窗運行后添加
end: function(){
//任何對父類頁面操作
}
1 layer.open({ 2 type: 2, 3 area: [w+'px', h +'px'], 4 fix: false, //不固定 5 maxmin: true, 6 shade:0.4, 7 title: title, 8 content: url, 9 end: function(){ 10 window.parent.location.reload(); //刷新父頁面 11 } 12 });