固定div右侧的悬停菜单 [英] hover-menu in right side of fixed div
本文介绍了固定div右侧的悬停菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个固定位置的div(顶部面板),它还包含最右边的设置菜单(目前通过浮动)。
I have a div with a fixed position (a top panel) which shall also contain a settings menu at the far right (currently via floating).
悬停时在设置图像上,我想在图像下方显示一个菜单。
我希望菜单与图像一样对齐。
When hovering over the settings-image, I want to display a menu below the image. I want the menu to be aligned to the right side just like the image.
<div id="panel" style="position:fixed">
<panel-entry 1>
<panel-entry 2>
<panel-entry n>
<div id="settings" style="float:right/snapped to the right side>
<img src=settings>
<ul>
<li>setting 1</li>
<li>setting 2</li>
<li>setting n</li>
</ul>
</div>
</div>
使用jQuery的任何想法非常感谢,随意重新安排任何HTML。
Any idea using jQuery very much appreciated, feel free to rearrange any html.
推荐答案
不需要jQuery,只需给你的#面板
宽度:
No jQuery necessary, just give your #panel
a width:
#panel {
position: fixed;
width: 100%;
}
#settings {
float: right;
}
请参阅 DEMO 。
这篇关于固定div右侧的悬停菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文