cactus1000
Programmer
I have a menu bar that currently requires a mouse click to open the second-level pull-out menu. I have been asked to change it from opening after a "click" to opening on a mouseover.
I changed this:
<a href="javascript
ulloutStart(0)">whatever.jpeg</a>
<a href="javascript
ulloutStart(1)">whatever1.jpeg</a>
etc.
to this:
<IMG SRC="whatever.jpeg" OnMouseover="javascript
ulloutStart(0)">
<IMG SRC="whatever1.jpeg" OnMouseover="javascript
ulloutStart(1)">
etc.
This works great as long as I mouse over the images in order (1 through 8). However, If I drag the cursor from image 1 to, say, image 5 (dragging the cursor over images 2, 3 and 4), the pull-out menu for image 2 will not close.
I know I need to change something in one of the pullout functions below, but I don't know what.
Does anyone know a solution to this? Do I need a onMouseout event?
Here is the code for the pull-out menus:
<script language="JavaScript" src="dynlayer.js"></script>
<script language="JavaScript">
function init() {
pulloutWindow = new Array
for (var i=0;i<=8;i++) {
pulloutWindow = new DynLayer('pullout'+i+'Window')
pulloutWindow.slideInit()
}
pulloutActive = false
pulloutShown = 0
}
function pulloutStart(i) {
if (i!=pulloutShown) {
pulloutActive = true
pulloutWindow[pulloutShown].slideTo(-285,null,15,15,'pulloutEnd('+i+')')
}
}
function pulloutEnd(i) {
pulloutShown = i
pulloutWindow.slideTo(0,null,15,15,'pulloutActive==false')
}
function conditionalResize() {
if (navigator.appName == "Netscape"
history.go(0)
}
//-->
</script>
I changed this:
<a href="javascript
<a href="javascript
etc.
to this:
<IMG SRC="whatever.jpeg" OnMouseover="javascript
<IMG SRC="whatever1.jpeg" OnMouseover="javascript
etc.
This works great as long as I mouse over the images in order (1 through 8). However, If I drag the cursor from image 1 to, say, image 5 (dragging the cursor over images 2, 3 and 4), the pull-out menu for image 2 will not close.
I know I need to change something in one of the pullout functions below, but I don't know what.
Does anyone know a solution to this? Do I need a onMouseout event?
Here is the code for the pull-out menus:
<script language="JavaScript" src="dynlayer.js"></script>
<script language="JavaScript">
function init() {
pulloutWindow = new Array
for (var i=0;i<=8;i++) {
pulloutWindow = new DynLayer('pullout'+i+'Window')
pulloutWindow.slideInit()
}
pulloutActive = false
pulloutShown = 0
}
function pulloutStart(i) {
if (i!=pulloutShown) {
pulloutActive = true
pulloutWindow[pulloutShown].slideTo(-285,null,15,15,'pulloutEnd('+i+')')
}
}
function pulloutEnd(i) {
pulloutShown = i
pulloutWindow.slideTo(0,null,15,15,'pulloutActive==false')
}
function conditionalResize() {
if (navigator.appName == "Netscape"
history.go(0)
}
//-->
</script>