简体   繁体   English

固定顶部栏中的菜单

[英]menu inside a fixed top bar

I have a web page having fixed top header in which a drop down jQuery menu is placed.我有一个带有固定顶部标题的网页,其中放置了一个下拉 jQuery 菜单。 I put a banner image just below this fixed header.我在这个固定标题下方放置了一个横幅图像。 My problem is the menu sub items that are just above the image are appearing behind the image.我的问题是图像正上方的菜单子项出现在图像后面。 Also the menu gets closed when mouse move out of the fixed header for those menu items which do not appear above the image.当鼠标移出那些没有出现在图像上方的菜单项的固定标题时,菜单也会关闭。 Here is the link of the files: http://www.filedropper.com/projectv5210这是文件的链接: http : //www.filedropper.com/projectv5210

I am sorry for not creating a fiddle as the code is big and not putting here because I always have issues writing codes here, I am new to this site.我很抱歉没有创建小提琴,因为代码很大并且没有放在这里,因为我在这里编写代码总是有问题,我是这个网站的新手。 Please help.请帮忙。 Thanks in advance!提前致谢!

[Edited] [编辑]

Thanks for the quick responses.感谢您的快速回复。 I have a another issue with the jQuery menu.我的 jQuery 菜单还有一个问题。 I want to grow the menu to another level.我想把菜单增加到另一个层次。 I mean I want to open another sub menu when hovering mouse on the menu sub items.我的意思是我想在将鼠标悬停在菜单子项上时打开另一个子菜单。

Please let me know if I need to start a new thread for this.如果我需要为此启动一个新线程,请告诉我。

#navigation{
    z-index: 9999;
}

只需为菜单放置比 css 中的图像更大的 z-index。

You should start playing with z-index, http://www.w3schools.com/cssref/pr_pos_z-index.asp你应该开始玩 z-index, http://www.w3schools.com/cssref/pr_pos_z-index.asp

The z-index property specifies the stack order of an element. z-index 属性指定元素的堆栈顺序。

An element with greater stack order is always in front of an element with a lower stack order.具有较大堆栈顺序的元素始终位于具有较低堆栈顺序的元素之前。

So, if the slideshow's z-index is less than the navigation, the slideshow will be stacked below the navigation, and vice verse.因此,如果幻灯片的 z-index 小于导航,则幻灯片将堆叠在导航下方,反之亦然。 so you might add:所以你可以添加:

#slideshow {
    z-index: -1;
}

    /* Or */

#navigation {
    z-index: 999;
}

    /* Or */

#slideshow {
    z-index: 0;
}
#navigation {
    z-index: 1;
}

The second one makes the #navigation menu higher than most of the page's elements.第二个使#navigation 菜单高于页面的大多数元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM