Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2005
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hide select boxes with in div area

    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.
    Thanks & Regards,
    Srikanth S

  • #2
    Regular Coder Nischumacher's Avatar
    Join Date
    Oct 2005
    Location
    Bombay, India
    Posts
    196
    Thanks
    0
    Thanked 2 Times in 2 Posts
    HoPe THiS HeLPS...
    Code:
    <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>
    Last edited by Nischumacher; 01-18-2007 at 12:23 PM.
    - NS 666
    .net DEVILoper


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •