Opera 中的下拉菜单损坏
我只是碰巧在 Opera 中检查了我的网站,我(愚蠢地)已经有几周没有这样做了,结果发现我的下拉菜单完全损坏了。当我将鼠标悬停在父项上时,所有菜单项都会移动,因此菜单会中断。在我检查过的任何其他浏览器中都不会发生这种情况。
任何人都可以看到我的代码中可能导致此问题的任何内容吗?
谢谢
$(document).ready(function () {
$('#nav li').hover(
function () {
$('ul', this).slideDown(200);
},
function () {
$('ul', this).slideUp(100);
}
);
});
CSS
ul#nav {list-style: none; white-space: nowrap; float: right; position: absolute; bottom: 10px; right: 0;}
ul#nav li {display: inline; margin-right: 10px; padding: 0 10px; position: relative; text-transform: uppercase;}
ul#nav li.last {margin-right: 0;}
ul#nav li.slash {padding: 0;}
ul#nav li a {text-transform: uppercase; font-size: 12px; color: black; padding: 10px 0 10px 10px; margin-bottom: 10px;}
ul#nav li a:hover {text-decoration: underline;}
ul#nav li a.active {font-style: normal; text-decoration: underline;}
ul#nav li a.active:hover {color: black;}
ul#nav li.parent_selected, ul#nav li.selected {font-style: italic;}
#nav li ul {position: absolute; top: 26px; right: 0; padding: 20px 0 10px 20px; background-color: #f6f6f6; border: 1px solid #ccc; text-align: right; z-index: 999;}
#nav li ul li {display:block; margin-bottom: 10px; padding: 0;}
#nav li ul li a {text-transform: none; font-size: 12px; color: black;}
#nav li ul li a:hover {text-decoration: underline;}
因为它似乎适用于所有主要浏览器(除了 Opera),我对是否要摆弄它犹豫不决,直到我不知道它哪里出了问题。
谢谢
I just happen to check my site in Opera which I (stupidly) hadn't done for a few weeks, only to discover that my drop-down menu is completely broken. When I hover over a parent item, all the menu items move around so the menu breaks. This doesn't happen in any other browser that I've checked.
Can anyone see anything that may be causing it in my code?
Thanks
$(document).ready(function () {
$('#nav li').hover(
function () {
$('ul', this).slideDown(200);
},
function () {
$('ul', this).slideUp(100);
}
);
});
CSS
ul#nav {list-style: none; white-space: nowrap; float: right; position: absolute; bottom: 10px; right: 0;}
ul#nav li {display: inline; margin-right: 10px; padding: 0 10px; position: relative; text-transform: uppercase;}
ul#nav li.last {margin-right: 0;}
ul#nav li.slash {padding: 0;}
ul#nav li a {text-transform: uppercase; font-size: 12px; color: black; padding: 10px 0 10px 10px; margin-bottom: 10px;}
ul#nav li a:hover {text-decoration: underline;}
ul#nav li a.active {font-style: normal; text-decoration: underline;}
ul#nav li a.active:hover {color: black;}
ul#nav li.parent_selected, ul#nav li.selected {font-style: italic;}
#nav li ul {position: absolute; top: 26px; right: 0; padding: 20px 0 10px 20px; background-color: #f6f6f6; border: 1px solid #ccc; text-align: right; z-index: 999;}
#nav li ul li {display:block; margin-bottom: 10px; padding: 0;}
#nav li ul li a {text-transform: none; font-size: 12px; color: black;}
#nav li ul li a:hover {text-decoration: underline;}
As it seems to be working in all the major browsers (except Opera) I'm hesitant about fiddling with it until I no where it's going wrong.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我以前去过那里(并且经常):Opera(无论如何这是正确的事情)期望一切都是明确的。虽然我可以在几乎任何其他浏览器中逃脱丢失的内容,但如果我不在一个项目中执行“清除两者”或“显示块”,那么 Opera 中的所有内容都会不同步。
检查每个项目的宽度、高度、浮动等。PS
:我什至没有看你的代码。
I have been there before (and often): Opera (which is the right thing to do anyways) expect everything to be explicity. While I can get away with missing stuff in just about any other browser, if I do not, for example, do a "clear both" or "display block" in one item, everything gets out of sync in Opera.
Check every item for with, height, floating, etc.
PS: I did not even look at your code.