I am posting this having tried all solutions offered here in the issues section...

You can see the problem live here (log in as test/test). When you hover on "create content" menu it goes under the category select, but only on IE. Attached is a screenshot.

This originally occured on my new custom theme, but to verify that the problem is real I reduced this to bluemarine with "plain vanilla" nice menus module in the header block.

Any ideas or suggestions?

Comments

dkruglyak’s picture

OK, I have done some investigation and looks like there is a known IE bug with SELECT elements always disobeying the z-index flow:
http://www.codetoad.com/forum/20_22736.asp

A solution offered is to create an invisible IFRAME and place it over SELECT. The question is how to do this only when a menue expands and make sure IFRAME only follows menu shape, i.e. does not obstruct SELECT if menu does not open exactly over it.

I wonder what is the best way to patch the module...

dman’s picture

This is (as I guess you found) very very normal. A limitation of the browser.
You are likely to find the same thing in activeX, Video and java plugins.
Solution is non-trivial. Good luck!

dkruglyak’s picture

Status: Active » Needs work
StatusFileSize
new1.72 KB

I made a partial fix by modifying the existing JavaScript hack.

What I did is add an extra onmouseover / onmouseout handlers to create an IFrame in the same shape / positioning as expanding menu. This works fine with the first level menu (drop down, as in the original screenshot).

However, the second level menu (sliding right) is not being fixed. For whatever reason the size of that menu (after onmouseover!) is being returned as 0x0, making IFrame dimensions impossible to guess (even though it shows up fine!). Moving mouse around results in IFrames finally showing up but in the wrong place.

I am no expert on DOM scripting so I hope someone could take a look at the code.

dkruglyak’s picture

Title: Nice Menus conflicts with form elements (selects) on IE » Fix IE z-index bugs
StatusFileSize
new93.81 KB

Attached is the screenshot of the problem at the second level. This can be seen live at my test site in the original issue.

Floris’s picture

MS is giving us a really hard time with this kind of crap, why is the nicely described CSS specification to hard to read for them. The way I work around is now is displaying the blocks with the nice menus in it last. I'm using the ADC theme with the patch to have topblocks and footer. Originally the topblocks are send first to the output which makes in fact my menus disappear behind the right and left blocks (not the content since this was allready set to be outputted first). But after sending the topblocks as last block to the output the nice menus are nice :). In this configuration I still might have problems with nice menus in the right or left block getting under my bottomblock, sending bottomblocks to the output as first (after content) resolves this.

$output .= $content
$output .= $leftblocks ? "

$leftblocks

\n" : "";
$output .= $rightblocks ? "

$rightblocks

\n" : "";
$output .= $bottomtblocks ? "

$bottomblocks

\n" : "";
$output .= $topblocks ? "

$topblocks

\n" : "";

hope this helps some people out.

regards

dkruglyak’s picture

To be sure I understand, simply reversing the output order of region DIVs solves the problem? Did you test this specifically with this SELECT issue?

If this fix works this is really amazing...

Floris’s picture

Yes in deed.
According to bug reports I've read the select has nothing to do with it. It just has to do with IE restarting it's Z-index on top of previous divs when a new div is started and that new div uses position (whether absolute or relative). The simplest explication i found here, but as I tested using relative or positive positions give the same problem. The only solution I saw was or erasing all the positions, which off course wasn't possible, or put the div's I wanted on top as low as possible in the output of my template. Since CSS is so flexible you can always try it out and I hope it works out for you to.

Floris’s picture

with here I meant Here

Floris’s picture

Ok I was over-enthousiastic. I thought IE only had one z-index bug (silly me), when it comes to windowed controls like select boxes changing the order of the divs doesn't help. So you can disregard most of what I said unfortunately.

dkruglyak’s picture

OK, I get it. The bug you were referring to is described pretty well here, with solutions that do not require rearranging DIVs: http://www.aplus.co.yu/css/z-pos/index.php

SELECT bug is a different one and is very nasty. This form element ignores z-index entirely. However, there is an IFRAME fix which I partially implemented in my JS patch.

I am not a DOM scripting guru, so I only made it work for first-level nice-menu flyout. Hope someone with better DOM skills could finish it off for second level...

mancini’s picture

Thanks to dkruglyak. Your nice menu patch help me solve the problem!

paulstav416’s picture

#lgt {
z-index: 1000 !important;
position:relative;
}

Did it for me, where #lgt is the header div.

treylane’s picture

dkruglyak - just add these lines into your 'with' block and you should be pretty much set. Still flashes a little bit in IE, but it's at least usable now.

left = ul.offsetLeft + 'px';
top = ul.offsetTop + 'px';

treylane’s picture

Eh, full paste. zIndex helps with tinymce module overlap.

function addIFrame(node) {
node.style.zIndex = 200;
ul = node.lastChild;
h = ul.clientHeight;
w = ul.clientWidth;
var iframe = document.createElement('iframe');
with (iframe.style) {
position = 'absolute';
height = h + 'px';
width = w + 'px';
left = ul.offsetLeft + 'px';
top = ul.offsetTop + 'px';
border = '0';
}
node.appendChild(iframe);
}

dietsmoke’s picture

Hi,

I'm having problems with the nice menus in IE as well and I have no idea of how to fix this issue. I tried to increase the z-index but that doens´t work at all and most of the other solutions posted here I don't understand.

Firefox e.g. works fine

Please have a look: Here

any suggestions?

treylane’s picture

StatusFileSize
new2.35 KB

A working (ish) nice_menus.js should be attached. I've added comments for '+2' and 'icons/blank.gif', which are bits of code that might not be needed for all installations, but are at least good to note.

ymmatt’s picture

I would like to see someone implement the fix from this page for Nice Menus

I con't know much about javascript but it seems like this could be added to the IEHoverPseudo function and with a little css tweaking all would be well

ymmatt’s picture

I think I love you Treylane, that fix worked perfectly for me.

Thank you, thank you, thank you!

dkruglyak’s picture

Component: Browser Compat » User interface
Status: Closed (duplicate) » Needs work

Works for me too, though there is still a little quirk.

When I use the *second-level* menu (down-then-right), the IFrame shows up only when the mouse hovers over the second level (right), but not the first (down). This results in temporary state of having the second level menu under the SELECT.

Jim@drupal.be’s picture

got the same problem with jscalendar.
Anyone got a solution for that one.

emackn’s picture

Good fix,
I found one small bug, and can't see to find a work around. For me anyway, whenever my mouse cursor is over a menu item when the page loads, that menu will no longer drop down.

Anyone else seen this?

emackn’s picture

Ok, I fixed my problem by adding a check to the removeIFrame function. By loading the page with the mouse over the menu item, the IFRAME was never loaded for that item, then moving the mouse out of that item, was removing my UL tag. Regardless if you had the same problem.. It's probably a good idea to include this check.

  function removeIFrame(node) {
    iframe  = node.lastChild;

    /*** IFRAME CHECK ***/
    if(iframe.nodeName == "IFRAME") { 
      removeNode(iframe); 
    }
  }
dkruglyak’s picture

Component: User interface » Browser Compat
Status: Needs work » Closed (duplicate)

I think the time has come to mark this one as duplicate and focus on 5.x version with jQuery.

Please comment on this new thread: http://drupal.org/node/141135

dkruglyak’s picture

Component: User interface » Browser Compat
Status: Needs work » Closed (fixed)

4.7.x is obsolete. Closing.

caiman’s picture

Thank u paulstav416. You are right.

oda’s picture

A dirty workaround is to add to page.tpl.php:

  <script>
    //http://www.vancelucas.com/blog/fixing-ie7-z-index-issues-with-jquery/
    if($.browser.msie&&parseInt($.browser.version)<=7){
        $(document).ready(function() {
        var zIndexNumber = 10000;
        $('div').each(function() {
          $(this).css('zIndex', zIndexNumber);
          zIndexNumber -= 10;
        });
      });
    }
  </script>

Reference: http://www.vancelucas.com/blog/fixing-ie7-z-index-issues-with-jquery/

R-H’s picture

I was able to solve this issue by setting z-index on parent div.

This page describes the solution. Quite simple. Don't worry about setting z-index on the menu. Set it on the div that holds the menu.

http://webdemar.com/webdesign/superfish-jquery-menu-ie-z-index-bug/#comm...

Would be nice to add this to the FAQ!

draganFSD’s picture

ill make a tattoo with oda name ;)

it solves my problem with nicemenu and slideshow

thanks!!!