Hi guys.
I have a tricky question.
I want to call a function as soon as i start using the menu and another as soon as I exit the menu. I got the exit working, as I just put a call in the closeallmenus function.
Where do I need to put the call that i want to execute when I hover over the first level items. I can't use the popi function, because that gets called everytime a new menu item is popped up.
Please could someone help me?
Thanks.
cX
Calling other functions when i start and exit the menu
-
- Beginner
- Posts: 4
- Joined: Thu Oct 17, 2002 12:00 pm
- Location: Johannesburg, Gauteng, South Africa
- Contact:
Calling other functions when i start and exit the menu
One day we'll all look back at this, laugh nervously, and change the subject...
Hi chemicalX,
If I understand you correctly, the offfunction alternate property might serve your purpose (you might also find onfunction useful). You would want to use the property in your first level item definitions. The Activating Functions example discusses these alternate properties and provides and example that you can download.
Hope that helps,
Kevin
If I understand you correctly, the offfunction alternate property might serve your purpose (you might also find onfunction useful). You would want to use the property in your first level item definitions. The Activating Functions example discusses these alternate properties and provides and example that you can download.
Hope that helps,
Kevin
-
- Beginner
- Posts: 4
- Joined: Thu Oct 17, 2002 12:00 pm
- Location: Johannesburg, Gauteng, South Africa
- Contact:
Kevin, me again.
Okay, that didn't work heheh.
I tried what you suggested, and it looked like this
The "HideCombos()" function is used to hide all select boxes in the document, and the "ShowCombos()" is used to show them again. This is to get past the menu going under any dropdown boxes. I tried the sample that you had to put the entire form into a div, and that didn't work either.
Putting the "HideCombos()" function call in the "popi" function works, but then it calls it every time that I move over a new work item, which slows my browser down to a grinding halt, as it loops through the whole form every time I call the function.
The "ShowCombos()" function is working perfectly, cos I call that in the "closeallmenus" function. It's just the start that I need to get sorted out.
So, in essence, what I wanna do is call the "HideCombos()" function as soon as I hover over the first menu item (start using the menu), and call the "ShowCombos()" function again when I exit the menu (which I've done)
And that's it
Thanks again for your help Kevin.
Johann.
PS: Another thing is that I still want the dropdown menu to pop up for the menu item when I hover over it, so I need to keep the "show-menu=downloads" section.
Okay, that didn't work heheh.
I tried what you suggested, and it looked like this
Code: Select all
,"Hide combos","onfunction=HideCombos();offfunction=ShowCombos();",,,0
Putting the "HideCombos()" function call in the "popi" function works, but then it calls it every time that I move over a new work item, which slows my browser down to a grinding halt, as it loops through the whole form every time I call the function.
The "ShowCombos()" function is working perfectly, cos I call that in the "closeallmenus" function. It's just the start that I need to get sorted out.
So, in essence, what I wanna do is call the "HideCombos()" function as soon as I hover over the first menu item (start using the menu), and call the "ShowCombos()" function again when I exit the menu (which I've done)
And that's it
Thanks again for your help Kevin.
Johann.
PS: Another thing is that I still want the dropdown menu to pop up for the menu item when I hover over it, so I need to keep the "show-menu=downloads" section.
One day we'll all look back at this, laugh nervously, and change the subject...
Hi Johann,
You say it didn't work, but I'm wondering what the actual result was. Did you get anything? Not sure if this'll get you any further but I think that your code,
should actually be
Note the # in place of an actual URL.
In the case where you need to use show-menu in the URL field, you could put the onfunction and offfunction calls in the alternate URL field, like this:
Of course, the onfunction is called every time you mouse over the menu item and the offfunction is called every time you mouse out, which is probably what you want to implement in a drop-down menu that overlaps a select field.
BTW, I'm just a user like you, so the examples on the Milonic website aren't mine. I've never actually tried the DIV trick to hide form elements, but it does seem to be the approach that most people discuss here.
Cheers,
Kevin
You say it didn't work, but I'm wondering what the actual result was. Did you get anything? Not sure if this'll get you any further but I think that your code,
Code: Select all
,"Hide combos","onfunction=HideCombos();offfunction=ShowCombos();",,,0
Code: Select all
,"Hide combos","# onfunction=HideCombos();offfunction=ShowCombos();",,,0
In the case where you need to use show-menu in the URL field, you could put the onfunction and offfunction calls in the alternate URL field, like this:
Code: Select all
,"Downloads","show-menu=downloads","# onfunction=HideCombos();offfunction=ShowCombos();",,0
BTW, I'm just a user like you, so the examples on the Milonic website aren't mine. I've never actually tried the DIV trick to hide form elements, but it does seem to be the approach that most people discuss here.
Cheers,
Kevin