...

View Full Version : Hide select boxes with in div area



Srikanth.S
01-03-2007, 04:52 PM
Hi All,

I using a DIV element to show/hide some text content on a image mouseover/mouseout. In IE select boxes takes the top level index and displays over the DIV element. Is it possible to find and hide the select boxes, if present with in the DIV element area. I don't want to hide all the select boxes using forms, need to hide the select boxes specifically found with in the DIV content area.

Awaiting your replies.

Nischumacher
01-18-2007, 12:11 PM
HoPe THiS HeLPS...

<html>
<head>
<script>
var elmtDiv = '';
var elmtSelect = '';
function show(divName) {
elmtDiv = document.getElementById(divName);
elmtSelect = elmtDiv.getElementsByTagName('SELECT');
for(var i=0; i<elmtSelect.length; i++) {
elmtSelect[i].style.display = 'block';
}
}
function hide(divName) {
elmtDiv = document.getElementById(divName);
elmtSelect = elmtDiv.getElementsByTagName('SELECT');
for(var i=0; i<elmtSelect.length; i++) {
elmtSelect[i].style.display = 'none';
}
}
</script>
</head>
<body>
<div id="d1">
<table>
<tr>
<td>
<img src="images/img1.jpg" onMouseOut="show('d1')" onMouseOver="hide('d1')">
</td>
<td>
<SELECT NAME="pizzasize">
<OPTION VALUE="s">small
<OPTION VALUE="m">medium
<OPTION VALUE="l">large
</SELECT>
</td>
</tr>
</table>
</div>
<br><br>
<div id="d2">
<table>
<tr>
<td>
<img src="images/img2.jpg" onMouseOut="show('d2')" onMouseOver="hide('d2')">
</td>
<td>
<SELECT NAME="shirtsize">
<OPTION VALUE="m">medium
<OPTION VALUE="xl">Xtra Large
<OPTION VALUE="xxl">Xtra Xtra Large
</SELECT>
</td>
</tr>
</table>
</div>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum