Layer组件中,如何实现多个iframe弹出层的灵活打开、关闭及参数传递?

更新于
2026-10-03 00:57:44
0阅读来源:SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计1320个文字,预计阅读时间需要6分钟。

一、Layer简介Layer是一款近年来备受欢迎的web弹层组件,基于jQuery开发,易于使用、实用性强,兼容包括IE6在内的所有主流浏览器,拥有丰富的可自定义功能。

Layer官网地址:http://layer.layui.com/

一、Layer简介

Layer是一款近年来备受青睐的web弹层组件,基于jquery,易用、实用,兼容包括IE6在内的所有主流浏览器,拥有丰富强大的可自定义的功能。

Layer官网地址:layer.layui.com/

二、多个iframe弹出层(非嵌套)

1.打开iframe弹出层js代码

(1)示例一:

layer.open({ type: 2, title: 'layer mobile页', shadeClose: true, shade: 0.8, area: ['380px', '90%'], content: 'mobile/' //iframe的url });

content参数可传入要打开的页面,type参数传2,即可打开iframe类型的弹层

(2)示例二:

layer.open({ type: 2, title: false, closeBtn: 0, //不显示关闭按钮 shade: [0], area: ['340px', '215px'], offset: 'rb', //右下角弹出 time: 2000, //2秒后自动关闭 anim: 2, content: ['test/guodu.html', 'no'], //iframe的url,no代表不显示滚动条 end: function(){ //此处用于演示 layer.open({ type: 2, title: '很多时候,我们想最大化看,比如像这个页面。

阅读全文

本文共计1320个文字,预计阅读时间需要6分钟。

一、Layer简介Layer是一款近年来备受欢迎的web弹层组件,基于jQuery开发,易于使用、实用性强,兼容包括IE6在内的所有主流浏览器,拥有丰富的可自定义功能。

Layer官网地址:http://layer.layui.com/

一、Layer简介

Layer是一款近年来备受青睐的web弹层组件,基于jquery,易用、实用,兼容包括IE6在内的所有主流浏览器,拥有丰富强大的可自定义的功能。

Layer官网地址:layer.layui.com/

二、多个iframe弹出层(非嵌套)

1.打开iframe弹出层js代码

(1)示例一:

layer.open({ type: 2, title: 'layer mobile页', shadeClose: true, shade: 0.8, area: ['380px', '90%'], content: 'mobile/' //iframe的url });

content参数可传入要打开的页面,type参数传2,即可打开iframe类型的弹层

(2)示例二:

layer.open({ type: 2, title: false, closeBtn: 0, //不显示关闭按钮 shade: [0], area: ['340px', '215px'], offset: 'rb', //右下角弹出 time: 2000, //2秒后自动关闭 anim: 2, content: ['test/guodu.html', 'no'], //iframe的url,no代表不显示滚动条 end: function(){ //此处用于演示 layer.open({ type: 2, title: '很多时候,我们想最大化看,比如像这个页面。

阅读全文