js、jQuery、layer實現彈出層的打開、關閉


打開layer

 

layer.open({
   type: 2,
   title: '新增收貨地址',
   shadeClose: true,//點擊陰影關閉
   shade: 0.8,
   area: ['900px', '60%'],
   content: [Think.U('Home/UserAddress/addAddress')]
});

 

//捕獲頁
                  layer.open({
                      type: 1,
                      area: ["auto", "auto"],
                      shade: 0.3,//遮罩透明度,或false沒有遮罩
                      title: false, //不顯示標題
                      content: $('.user_info'), //捕獲的元素,注意:最好該指定的元素要存放在body最外層,否則可能被其它的相對元素所影響
                      cancel: function () {
                          //layer.msg('捕獲就是從頁面已經存在的元素上,包裹layer的結構', { time: 5000, icon: 6 });
                      }
                  });

 

 

 

 

 

 

執行保存操作后關閉

 

$.post(Think.U('Home/UserAddress/edit'),params,function(data,textStatus){
   var json = GY.toJson(data);
   //alert(JSON.stringify(json));
if(json.status>0){
    parent.window.location.reload();
         var index = parent.layer.getFrameIndex(window.name); //獲取窗口索引
parent.layer.close(index);
}else{ }});

 

 
       


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM