排名
7
文章
192
粉丝
15
评论
16
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术

通过window.frames["name"]可以调用layer弹页窗指向页面的方法
- //例如目标页面存在一个方法
- var update = function ()
- {
- alert("hello");
- }
弹窗主页面调用
- window.frames["name"].update()
注意:layer弹窗生成的盒子每一次生成的名字都不同,所以名字需要是动态的
- layer.open({
- title: '修改',
- skin: 'layui-layer-lan',
- area: ['470px', '280px'],
- btn: ['确定', '取消'],
- type: 2,
- content: "目标页面",
- yes: function myfunction(index) {
- //index表示弹窗次数
- window.frames["layui-layer-iframe" + index].update();
-
-
- });
-
- //关闭所有layer
- layer.closeAll();
- },
评价