Results 1 to 1 of 1

Thread: How to hide the Form select option onmouseout IE6?

  1. #1
    Join Date
    Feb 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to hide the Form select option onmouseout IE6?

    Hi,
    I am trying to figure it out how to to hide in onmouseout the select options of a form. Below is the code I got so far.

    It isn't working in IE6.
    I am stuck with this so any help will be greatly appreciated.
    The z-index is also a problem in IE6.

    Reference page:
    http://www.oarso.net/kitres/




    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <script type="text/javascript">
    
    function hideSelectSearchCon() {
        var selectSearchCon = document.getElementById("catGroup");
        selectSearchCon.blur();
    }
    
    function check_mouse_pos(e) {
        if (typeof e == 'undefined') {
            e = window.event;
        }
        var src = typeof window.event == 'undefined' ? e.target : e.srcElement;
        var opt = { 'SELECT': 1, 'OPTION': 1 };
    
        if (typeof opt[src.nodeName] == 'undefined') {
            hideSelectSearchCon();
            remove_event(document, check_mouse_pos);
        }
    }
    
    function add_event(obj, func) {
        if (typeof window.addEventListener != 'undefined') {
            obj.addEventListener('mouseover', func, true);
        } else {
            obj.attachEvent('onmouseover', func);
        }
    }
    
    function remove_event(obj, func) {
        if (typeof window.addEventListener != 'undefined') {
            obj.removeEventListener('mouseover', func, true);
        } else {
            obj.detachEvent('onmouseover', func);
        }
    }
    </script>
    
    </head>
    
    <body id="home">
    
    <!-- #search starts  -->
    
    
    <div id="search-container">
    	<div id="searchleft"><div id="searchright">
    		<div id="search">
    		<form action="/cgi-bin/dbsearch/displayList.cgi" method="post">
    		Search:
    				<select name="catGroup" id="catGroup" onclick="add_event(document, check_mouse_pos);" style="z-index: -2">
    						<option value="" selected="selected">Todos los Articulos</option>
    						<option value="Maquinas Ejercicio">Maquinas Ejercicio</option>
    						<option value="Material Deportivo">Material Deportivo</option>
    						<option value="Accesorios Deportes">Accesorios Deportes</option>
    						<option value="Mobliario Urbano">Mobliario Urbano</option>
    				</select>
    				<input type="submit" border="0" alt="Buscar" id="btn_search"/>
    		</form>
    		</div>
    	</div></div>
    </div>
    <!-- #search ends  -->
    
    
    </body>
    </html>
    Last edited by jscheuer1; 02-22-2008 at 03:46 PM. Reason: add code foramtting tags

Bookmarks

Posting Permissions

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