S
srampally
I need the capabilty to hide/show a selection list, just the way its
done at http://www.lufthansa.com (place the cursor over "Group
Companies"). However, I am looking for a javascript that is much
simpler. Here is what I have until now.
Problems with my code:
1. The selection list becomes invisible when I try to select an option
(in Firefox).
2. The selection list stays visible when I just place the cursor over
selection list and move the cursor out (without clicking).
Please help,
Shashi
<HTML>
<HEAD>
<script type="text/javascript">
function showSelect() {
element = document.getElementById('sort');
element.style.display = 'inline';
}
function hideSelect() {
element = document.getElementById('sort');
element.style.display = 'none';
}
</script>
</HEAD>
<BODY>
<div onMouseOver="javascript: showSelect(); return false;"
onMouseOut="javascript: hideSelect(); return false;" >
<label for="sort"><a href="javascript: void();">Sort:</a></label>
<div id="sort" style="display: none" onMouseOver="javascript:
showSelect(); return false;">
<select>
<option value="/woodpics/home.jsp?sortBy=1">Reverse
Chronological</option>
<option value="/woodpics/home.jsp?sortBy=2">Chronological</option>
<option value="/woodpics/home.jsp?sortBy=3">Title</option>
<option value="/woodpics/home.jsp?sortBy=4"># of Photos</option>
</select>
</div>
</div>
</BODY>
</HTML>
done at http://www.lufthansa.com (place the cursor over "Group
Companies"). However, I am looking for a javascript that is much
simpler. Here is what I have until now.
Problems with my code:
1. The selection list becomes invisible when I try to select an option
(in Firefox).
2. The selection list stays visible when I just place the cursor over
selection list and move the cursor out (without clicking).
Please help,
Shashi
<HTML>
<HEAD>
<script type="text/javascript">
function showSelect() {
element = document.getElementById('sort');
element.style.display = 'inline';
}
function hideSelect() {
element = document.getElementById('sort');
element.style.display = 'none';
}
</script>
</HEAD>
<BODY>
<div onMouseOver="javascript: showSelect(); return false;"
onMouseOut="javascript: hideSelect(); return false;" >
<label for="sort"><a href="javascript: void();">Sort:</a></label>
<div id="sort" style="display: none" onMouseOver="javascript:
showSelect(); return false;">
<select>
<option value="/woodpics/home.jsp?sortBy=1">Reverse
Chronological</option>
<option value="/woodpics/home.jsp?sortBy=2">Chronological</option>
<option value="/woodpics/home.jsp?sortBy=3">Title</option>
<option value="/woodpics/home.jsp?sortBy=4"># of Photos</option>
</select>
</div>
</div>
</BODY>
</HTML>