Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[“捕获层“低版本ie兼容性调整] #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zjruan
Copy link

@zjruan zjruan commented Mar 8, 2017

layerjs 是一个非常棒的弹窗库,官方介绍时说兼容ie6,但实际上是有一些问题的。“捕获页”是我们常用的一个功能之一,但它的实现方式,使得它不兼容低版本ie。

// 测试demo地址,http://layer.layui.com/
// 验证代码
layer.open({
  type: 1,
  shade: false,
  title: false, 
  content:$('#chutiyan'), 
  cancel: function(){
  }
});

问题原因:低版本ie有一个bug,就是 z-index 受其父元素z-index影响,当 a 元素的定位低于 其兄弟元素 b 的定位时,那么 a 元素所有的子元素 a-n 的定位都会低于 b元素

解决方案:将捕获元素至于页面的最底部并在原位置添加一个占位元素,当关闭弹窗时,再将占位元素还原为捕获元素

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant