简体   繁体   中英

Position div ontop of active select box

I have a dropdown menu which I want to position ontop of everything else. However if I click on a select and then hover over my dropdown menu the select options appear ontop of the menu. How can I get the hovered menu to appear ontop of the select?

在此输入图像描述

Sample code

http://jsfiddle.net/b2vak/6/

An easy fix would be to hide / show the select input on hover. Like this:

$("#menubar ul > li").hover(function() {
    $("#menu").show();
    $("select").hide();
}, function() {
    $("#menu").hide();
    $("select").show();
});

However I think this is not a very good solution, but the only one I can come up with :/

A better solution is with an iframe in the background. You can look at Stu Nicholls' example: http://www.cssplay.co.uk/menus/iframe-shim.html

or just do a google search: http://www.google.at/search?q=css+selectbox+iframe and you will find plenty of examples.

This is the only way, I know of, to do this cross browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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