Click to See Complete Forum and Search --> : context menu overlayed by select box in IE


emmav413
07-16-2007, 12:42 PM
Hi all,

I've got a select list that I want to right click on and show a context menu that applies only to the items in that list. I've managed to get the popup to appear by using some javascript I found online here (http://www.webtoolkit.info/javascript-context-menu.html):

It works perfectly for Firefox, however in IE the popup appears behind the select list box. I've tried setting the z-index, but that's not working out for me. Here's my html code (the css and js are the same as that in the link above). Any thoughts?


<body>
<script type="text/javascript" type='text/javascript' src="contextmenu.js">
</script>

<script type="text/javascript">
SimpleContextMenu.setup({'preventDefault':true, 'preventForms':false});
SimpleContextMenu.attach('container', 'CM1');
</script>

<form name='queryForm'>
<ul id="CM1" class="SimpleContextMenu">
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a></li>
<li><a href="#">Item 4</a></li>
</ul>

<!-- Add the field list -->
<div id='fieldListDiv' class="container">
<select id='fieldList' name='fieldList' size='10'>
</select>
</div>

</form>
</body>


Thanks,
em

felgall
07-16-2007, 02:49 PM
Select lists in IE6 and earlier and iframes in Opera 8 and earlier ALWAYS appear in front of everything else. The only solution for those browsers is to hide selects and iframes when you want something in front of them.

emmav413
07-16-2007, 03:32 PM
Thank you so much. I was going a little nuts trying to figure that one out.

em