作者:dongtiankzh | 来源:互联网 | 2023-05-19 06:06
ThewebsiteImdesigninghasafixedmenubehindthebody.Whenthemenuiconisclickedsomejquer
The website I'm designing has a fixed menu behind the body. When the menu icon is clicked some jquery shifts the body left. I've put a shadow on the body to make the fixed menu look like it's positioned underneath. In chrome, firefox, and safari everything works flawlessly. But in Internet Explorer the links in this menu can't be clicked because of the drop shadow coming from the body. Is there an easy fix to this, or a way to easily disable the css on ie?
我正在设计的网站背后有一个固定的菜单。单击菜单图标时,一些jquery将身体向左移动。我在身体上留下了一个阴影,使固定菜单看起来像位于下方。在chrome,firefox和safari中,一切都完美无瑕。但是在Internet Explorer中,由于来自正文的阴影,无法单击此菜单中的链接。是否有一个简单的解决方案,或一种方法轻松禁用ie?
Here's the relevant code:
这是相关的代码:
The shadow on the main content
主要内容的影子
.wrapper {
-webkit-box-shadow: 3px 0px 10px 1px rgba(0,0,0,1);
-moz-box-shadow: 3px 0px 10px 1px rgba(0,0,0,1);
box-shadow: 3px 0px 10px 1px rgba(0,0,0,1);
}
The fixed menu that displays when the menu button is clicked.
单击菜单按钮时显示的固定菜单。
.sidemenu {
position: fixed;
right: 0px;
top: 0px;
width: 260px;
height: 100%;
background: #2b2b2b;
z-index: -10;
overflow: hidden;
transition: 0.2s;
color: white;
text-align: center;
}
This worked: Added a Javascript function to detect Internet Explorer.
这工作:添加了一个Javascript函数来检测Internet Explorer。
if (detectIE() != false) {
$('.sidemenu').css('zIndex', '1000');
}
When the menu is clicked, the index is adjusted on ie to bypass all the other layers. Works well enough.
单击菜单时,将调整索引,即绕过所有其他图层。效果很好。
2 个解决方案