javascript - 响应式灯箱在 iPhone 中不起作用

标签 javascript css responsive-design lightbox

我们正在努力使灯箱响应

这是原始的 CSS:

#mageworxLightbox{ position: absolute;  left: 0; width: 100%; z-index: 60002; text-align: center; line-height: 0; }
#mageworxLightbox img{ width: auto; height: auto;}
#mageworxLightbox a img{ border: none; }
#mageworxOuterImageContainer{ position: relative; background-color: #fff; width: 250px; height: 250px; margin: 0 auto; }
#mageworxImageContainer{ padding: 10px; }

已编辑成:

#mageworxLightbox{ position: absolute;  left: 0; width: 100%; height: auto !important;  z-index: 60002; text-align: center; line-height: 0; }
#mageworxLightbox img{ width: auto; height: auto;}
#mageworxLightbox a img{ border: none; }
#mageworxOuterImageContainer{ width:80% !important; height: auto !important; position: relative; max-width: 600px; background-color: #fff; margin: 0 auto; }
#mageworxImageDataContainer{ width: 80% !important; height: auto !important; max-width: 600px; line-height: 2em;  }
#mageworxImageContainer{ padding: 10px; height: auto !important;  }

但关闭按钮在 iPhone 等设备上不再起作用,我不明白为什么;同样在横向模式下,图像未正确调整大小。

这是我们的页面: http://www.arredodesignonline.com/it/letto-design-imbottito-heart.html
(要查看灯箱,请在下拉菜单中选择“modello letto”,然后单击其中的任何图像都可以使用)

最佳答案

将此 css 添加到您的样式表中。某些元素具有冲突层,这会导致按钮位于某个层“下方”,因此您不是在单击按钮而是在某个不可见层上。

#mageworxImageDataContainer{
    ...
    position: relative;
}

关于javascript - 响应式灯箱在 iPhone 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33802284/

相关文章:

javascript - "goog.proto2.Message.set$Metadata"未定义错误

javascript - 突出显示 HTML 表格中的行(悬停在行和前面的行上)

图像断点 srcset - 如何处理中等视口(viewport)尺寸中使用的较大图像?

javascript - 元素只能在特定位置选择

javascript - React OIDC-Client IE Promise 未定义

javascript - 在node.js中使用xpath和xmldom替换部分xml

ios - 将 -apple-system 用于等宽和衬线

javascript - 使用带有 css bootstrap 的 jQuery 验证插件,突出显示错误的字段

datetime - mobiscroll 的开源替代品

Javascript 与通配符匹配 URL - Chrome 扩展