Layer is blocked by combo box

Discussion in 'JavaScript' started by welles, Mar 30, 2005.

  1. #1
    Hi all,

    I have a nevigation menu that uses javascript layer to create drop down menu effect. However, for some reason, the menu layer is blocked by the combo box on the page (in other words, the menu layer is behind the combo box). I've searched the web and found that I could set the z-index for ordering of the stack of the sibling layers. But, unfortunately, it only works for sibling layers, not combo box on the page. Can please anyone give me some directions?

    Thanks,
    Welles
     
    welles, Mar 30, 2005 IP
  2. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Keep in mind that z-index works only for positioned elements (i.e whose position property is not static). Check the position property throughout your HTML/CSS.

    J.D.
     
    J.D., Mar 30, 2005 IP
  3. marty

    marty Peon

    Messages:
    154
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The only solution I have ever found for this problem is to place the combo box within it's own div and set the combo boxes visibility to "hidden" on whatever event causes the menu layer to be displayed.

    Good luck :)

    Marty
     
    marty, Mar 31, 2005 IP
  4. nullbit

    nullbit Peon

    Messages:
    489
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Marty is correct, there is no real solution to this, it's a rendering bug in IE. Either take marty's advice or move the layer so it's not in the same space as the combo-box.
     
    nullbit, Mar 31, 2005 IP
  5. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I didn't know about this bug. A quick test shows that, IE simply ignores the position attribute and any relative elements following the combo box are not rendered correctly either:

    <html><head>
    <style type="text/css">
    div {width: 100px; height: 100px; background-color: #FEE; border: 1px solid red;}
    select {width: 100px; height: 100px; border: 1px solid blue; background-color: #EEF;}
    </style></head><body>
    <div style="z-index: 100">div1<br><strike>z-index</strike></div>
    <div style="position: relative; top: -50px; left: 50px; z-index: 10;">div2</div>
    
    <select name="cb1" style="position: relative; top: -100px; left: 100px; z-index: 20;">
    	<option selected>value1</option>
    	<option>value2</option>
    	<option>value3</option>
    </select>
    
    <div style="position: relative; top: -150px; left: 150px; z-index: 30;">div3</div>
    
    </body></html>
    Code (markup):
    J.D.
     
    J.D., Mar 31, 2005 IP
  6. marty

    marty Peon

    Messages:
    154
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    <script language="JavaScript" type="text/javascript">  	
    function hide(hider)  	
    {  		
        document.getElementById(hider).style.visibility = "hidden"  	
    }  	
    function show (shower)  
    {  		
    document.getElementById(shower).style.visibility = ""  	
    }  
    </script>    
    <a onmouseout="show('001')" onmouseover="hide('001')">[hide]</a>    
    <br>    
    <input id="001" type="text" name="dfd">
    Code (markup):
     
    marty, Apr 1, 2005 IP
  7. welles

    welles Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Solution found!

    http://www.codingforums.com/showthr...&threadid=28261
     
    welles, Apr 4, 2005 IP
  8. Albertraj

    Albertraj Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Layer is blocked by combo box

    --------------------------------------------------------------------------------

    Hi all,

    I have a nevigation menu that uses javascript layer to create drop down menu effect. However, for some reason, the menu layer is blocked by the combo box on the page (in other words, the menu layer is behind the combo box). I've searched the web and found that I could set the z-index for ordering of the stack of the sibling layers. But, unfortunately, it only works for sibling layers, not combo box on the page. Can please anyone give me some directions?
     
    Albertraj, Sep 1, 2005 IP
  9. tutty

    tutty Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    look at this:

    http://www.aplus.co.yu/wch/intro/
     
    tutty, Jan 4, 2006 IP
  10. legend2

    legend2 Well-Known Member

    Messages:
    1,537
    Likes Received:
    74
    Best Answers:
    0
    Trophy Points:
    115
    #10
    bottom of the line, IE is never as we expect it to.
     
    legend2, Jan 6, 2006 IP
  11. Eddie Traversa

    Eddie Traversa Peon

    Messages:
    4
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #11
    active content such as forms drop down lists etc needs a specialized fix for IE that involves an iframe. See here

    http://dhtmlnirvana.com/content/activecontentfix/active3.html

    Eddie
    http://dhtmlnirvana.com/
     
    Eddie Traversa, Jan 11, 2006 IP