菜单按钮下方的 jQuery SlideDown 移动 FF 中的所有其他按钮
我一直在开发一个菜单,并让它在 Chrome/Safari 中完美运行。 网址为http://www.penuli.nl/aboutvanwow.html。
但 FF 的工具提示给我带来了困难。 每次我将鼠标悬停在一个按钮上时,所有其他按钮(列表项内的 div)都会跳到其父项(列表项)的底部。 我不明白他们为什么这样做,因为所有的物品都足够大,可以彼此容纳,而不会“推”其他物品。
评论框中是我制作的有关菜单的插图的链接 (我没有足够的声誉点来发布图像)
使它可能有点复杂的事情(但它不应该与它有任何关系)是按钮动画进入页面。这意味着他们的位置是相对的。
感谢 Stackoverflow 的你们,我找到了一个解决方案,阅读了另一个问题,但这意味着我必须改变我的动画: 当我将溢出:隐藏应用于列表项时,它确实起作用,但是在单击事件后我有一个动画,这使得所有按钮“落下”到页面下方。当没有任何效果时,我当然可以取消该动画,更重要的是网站的工作是否整齐比动画或多或少,但对两者都适用的解决方案将是非常好的! 提前致谢。
一些CSS(没有一些用于开始和结束动画的行):
#wrap ol#menu{
margin-left: 0;
padding-left: 0;
width: 1000px;
height: 160px;
}
#wrap ol#menu li{
display: inline-block;
list-style-type: none;
width: 138px;
height: 160px;
background-image: url("/images/backgroundbutton.png");
background-repeat:no-repeat;
background-color: white;
cursor: pointer;
position: relative;
z-index: 0;
}
#wrap ol#menu li .button{
width: 138px;
height: 82px;
z-index: 2;
position: relative;
background-repeat:no-repeat;
}
ol#menu li:nth-child(7n+1) .button {
background-image: url("/images/button-1.png");
}
#wrap ol#menu li .tooltip{
background-image: url("/images/tooltip.png");
position: relative;
background-repeat:no-repeat;
top: -30px;
width: 138px;
height: 130px;
z-index: 1;
display: none;
}
I've been working on a menu and have it perfectly working in Chrome/Safari.
The URL is http://www.penuli.nl/aboutvanwow.html.
But FF is giving me a hard time with the tooltip.
Each time I hover over a button, all the other buttons (which are divs inside a list item) jump down to the bottom of their parent, the list item.
I can't understand why they do that, since all the items are big enough to fit into each other without 'pushing' other items around.
IN THE COMMENT BOX IS A LINK TO AN ILLUSTRATION I MADE ABOUT THE MENU
(i don't have enough reputation points to post images)
The thing that makes it maybe a bit more complicated (but it shouldn't got anything to do with it), is that the buttons animate into the page. This means that their position is relative.
I've found one solution thanks to you guys of Stackoverflow, reading another question, but this would mean I have to alter my animation:
overflow: hidden does work when I apply it to the list item, but I have an animation after a click events which makes all the button 'fall' down the page. When nothing works I can of course cancel that animation, it's more important the site works neatly then an animation more or less, but a solution which works for both would be excellent!
Thanks in advance.
Some CSS (without some lines for the start and end animation):
#wrap ol#menu{
margin-left: 0;
padding-left: 0;
width: 1000px;
height: 160px;
}
#wrap ol#menu li{
display: inline-block;
list-style-type: none;
width: 138px;
height: 160px;
background-image: url("/images/backgroundbutton.png");
background-repeat:no-repeat;
background-color: white;
cursor: pointer;
position: relative;
z-index: 0;
}
#wrap ol#menu li .button{
width: 138px;
height: 82px;
z-index: 2;
position: relative;
background-repeat:no-repeat;
}
ol#menu li:nth-child(7n+1) .button {
background-image: url("/images/button-1.png");
}
#wrap ol#menu li .tooltip{
background-image: url("/images/tooltip.png");
position: relative;
background-repeat:no-repeat;
top: -30px;
width: 138px;
height: 130px;
z-index: 1;
display: none;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使列表项浮动可以解决您的问题。
在您的
#wrap ol#menu li
规则中,交换:
与:(
保持显示:内联块不是问题,但不再需要它,因为元素是浮动的)
making the list items floating can fix your problem.
in your
#wrap ol#menu li
rule,exchange:
with:
(keeping the display:inline-block isn't a problem, but it is not needed anymore since the elements are floating)
哇,这非常奇怪。也许将您的列表项更改为 div 集合?
Wow, that is pretty weird. Maybe change your list items to a collection of divs?