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
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