You'll have to visit that page with a 5.0 version browser or newer, but I accomplished the affect by altering the visibility property of DIVs with JavaScript.
That's the script that I use. I didn't put in a time out, but on www.w3schools.com in their javascript tutorials, they have a reference to a setTimeout() function. I can't find it right off hand, but check it out. I played around with the function but couldn't get it to work if I had to reference more than 1 ID in the script.
I've done a little more playing around with the setTimeout function.
IN JAVASCRIPT
Code:
var callFunction = "hideMenuHelper()";
function hideMenu() {
setTimeout(callFunction, 500);
}
function hideMenuHelper {
document.getElementById("elementID").style.visibility = "hidden";
}
The setTimeout() function only executes script if it's saved as text inside quotes or stored in a variable. The number is for how many miliseconds will elapse before it executes the text script in the callFunciton variable.
You also might find more help by posting this same thing in the JavaScript forum. This is right up their alley.
The callFunction variable should be declared globally in your script.
When the onmouseout() event is captured, either by way of a DIV or <A> tag, you would call hideMenu(), which would then call hideMenuHelper() after 500 miliseconds. You can add arguments to the hide menu functions if you like so you can pass the ID of an object. I've done yet MORE playing around and came up with the code below. It's not fully functional yet, I can't seem to keep the menu visible after I mouse over the part that pops up.
See the attached txt file for the html and css I'm using.
I appreciate you looking at it but I am a novice programmer and what you said is greek to me, that is why I posted the code. What new code specifically, do I put where specifically?
I'm not 100% sure where to put the new code. With the setTimeout() function, there's another consideration - you may move the mouse off one menu and on to one of its submenus. The script will wait 500 milliseconds before making the menu disappear. What I've found is that the whole menu will disappear, or part of it, after you roll your mouse deeper into the menu.
That's kind of why I put a link to my code 'cause I'm no JavaScript wizard either
I'm still working on the menu and won't have much of an answer for you until I figure a few things out first.
Honestly your best bet is to post this in the DHTML forum. I'm still in the playing-around stage with Dynamic HTML, which is what we are dealing with.
I take it you got that script from DynamicDrive.com?
In any event, the script that I'll try to get working won't look much like the one you've got right now.
Bookmarks