layer.open彈出層的回調(返回值)


獲取layer.open彈出層的返回值

layer.open({
                    type: 2,
                    title: "設置圍欄",
                    shadeClose: true,
                    shade: 0.4,
                    area: ['90%', '90%'],
                    content: "/ElectronicFence/Map?id=" + id + "&shapeType=" + shapeType,
                    btn: ['確定','關閉'],
                    yes: function(index){
                        //當點擊‘確定’按鈕的時候,獲取彈出層返回的值
                        var res = window["layui-layer-iframe" + index].callbackdata();
                        //打印返回的值,看是否有我們想返回的值。
                        console.log(res);
                        //最后關閉彈出層
                        layer.close(index);
                    },
                    cancel: function(){
                        //右上角關閉回調
                    }
                });

詳情見:https://www.cnblogs.com/fjzhang/p/6232148.html

layer一款web彈層組件,其中有關於irame-父子操作可查看一下鏈接學習

http://layer.layui.com/?alone


免責聲明!

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



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