Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:07

Static HTML Object Based


Poster: mfurf
Dated: Thursday October 2 2003 - 19:17:05 BST

In the explanatory text for Static HTML Object Based menus, Andy says:
Quote:
The HTML used in this sample is:
<a href=yourlink.html onmouseover=popup("mainmenu") onmouseout=popdn()`CB`<font size=3 color=green`CB`Move Mouse Over Me</font`CB`</a`CB`

Does 'CB' mean "close bracket"? Is it necessary especially when the code in the same page is e.g.
Quote:
<a href="#" onmouseover="popup('milonic')" onmouseout="popdown()"><font
size="3" color="green">Milonic</font></a>


Anyway I've tried using the code and my problem is that the browser doesn't wait for the click or the mouseover, it executes it and the menu appears prematurely. My shortened html code is
Quote:
<a
href="#" onmouseover="popup(Main menu)" onmouseout="popdn()">
Mouse Here Please</a><br>
and I've experimented with the "CB" but still the menu executes on startup. The link has even changed colors as it has been clicked. I'm wondering if the problem lies with the "#" /mfurf


Poster: kevin3442
Dated: Friday October 3 2003 - 1:19:06 BST

Hi mfurf,

I'm not sure where your CB is coming from... what browser are you using to view that page? Any odd encoding selection? Anyway, I imagine that it's an artifiact of the html codes Andy uses to make the html viewable as text on the rendered page, rather than having the page process it as actual html. For example, he'd use the code, &lt; and &gt; to generate < and > respectively for a tag. I believe the CB you see is the way your browser renders the &gt; code. One thing is sure: you don't need a CB anywhere in the code.

The problem should not be with the #... that's just an anchor reference. Without seeing your code, I suspect that you may have alwaysvisible=1 in your Main menu definition. That'd be the first place I'd suggest looking, as it would explain the behavior you describe: causing the menu to be displayed when the page loads, instead of waiting for an event.

Hope that helps,

Kevin


Poster: mfurf
Dated: Friday October 3 2003 - 4:20:42 BST

Kev: Nice to see you're still ticking out there somewhere -- assuming you're the very knowledgeable Kevin of months ago before I had to put menus out of my mind for a while.
Quote:
I'm not sure where your CB is coming from... what browser are you using to view that page?

The CB I was talking about is
Code:
<a href=yourlink.html onmouseover=popup("mainmenu") onmouseout=popdn()`CB`<font size=3 color=green`CB`Move Mouse Over Me</font`CB`</a`CB`
in the explanatory text which accompanies the sample3 download but not when viewed from the topline menu on the Milonic site.

Another difference with the downloaded sample3 over the same site sample is that the second menuitem [links] doesn't show until I inserted top and left coordinates. Somehow they got left out in the downloaded version.

Yes, originally I did have the alwaysvisible tag wrongly toggled and that seems to solve that part of it, but interestingly, the submenus don't seem to fall correctly outside the iframe like they do if alwaysvisibile is toggled on. I need to experiment some more with this. Stand :?: :?: /mfurf


Poster: Andy
Dated: Friday October 3 2003 - 7:33:43 BST

The `CB` is something the system should have changed to a closing square bracket.

I've fixed it now.

Cheers
Andy.


Poster: Maz
Dated: Friday October 3 2003 - 16:48:54 BST

I haven't seen anything for onclick alwaysvisible on - alwaysvisible off, is this possible?

Thank you
maz


Poster: kevin3442
Dated: Saturday October 4 2003 - 7:21:31 BST

Hi Maz,

There's no such function built in, as far as I can see. But the following function should do the trick, letting you set any menu's alwaysvisible property programatically, from any object or link on your page (e.g., using another menu item, using an item within the same menu to keep it open, or an onclick event from an image, an href, etc.).

Code:
function mm_setAlwaysVisible(menuName, state)
{
  var menuNum = getMenuByName(menuName);
  _m[menuNum][8] = state;
}


Suppose you have a menu named "products". To turn alwaysvisible on for that menu, you'd call:
Code:
mm_setAlwaysVisible('products', true);

or
Code:
mm_setAlwaysVisible('products', 1);

To turn alwaysvisible off, you'd call:
Code:
mm_setAlwaysVisible('products', false);

or
Code:
mm_setAlwaysVisible('products', 0);

Note that this only affects the alwaysvisible property for the named menu, it does not affect whether the menu is displayed or not. In other words, changing a menu's alwaysvisible property to on will not cause the menu to open; it'll only make it stay open if it already is open, or after some other event opens it.

Hope that helps,

Kevin


Poster: kevin3442
Dated: Saturday October 4 2003 - 7:26:12 BST

Hi furf,
mfurf wrote:
Kev: Nice to see you're still ticking out there somewhere -- assuming you're the very knowledgeable Kevin of months ago before I had to put menus out of my mind for a while.

Nice to see you perusing the forums again too. I know some folks that might dispute the "very knowledgeable" part, but thanks just the same ;) . Yeah... I think it's the same me (kevin3442); we had a few interactions back then. I have also been on an extended menu hiatus, but I find the new one to be quite nice and am looking forward to using it.

See you around!

Kevin


Poster: Hergio
Dated: Saturday October 4 2003 - 21:17:16 BST

Hey Kevin, you tested that function right? And it works? Cuz a while back, like VERY early RCs I made one up on my own and I was switching the alwaysvisible tag around, but it would not show the menus correctly when I tried to view them after editting their alwaysvisible attribute programmatically. I was getting white boxes as menus and stuff. There seemed to be more to it then just the one flag. So if you tested it and it worked, AWESOME! let me know.


Poster: kevin3442
Dated: Sunday October 5 2003 - 7:32:39 BST

Hergio wrote:
Hey Kevin, you tested that function right?

Hi Dave,

I'm absolutely shocked and utterly horrified that you would even entertain the slightelst possibility, the faintest glimmer of a notion that I'd not test it. I'm stunned at the implication, the mere hint that I'm even remotely capable of suggesting a function before testing it... unless of course I'm using it on my own stuff; then I do it all the time! (I hope you realize that I'm just needling you a litte ;) )

It worked in my tests using IE6, NS7, NS...gag...4, Opera...'nother gag...6, and Opera7. I tidied the code and test page I used a little, and uploaded it for you (and any other curious person) in case you'd like to have a look. Anyone interested can download mm_alwaysVisible.zip here. Unzip the download file to a folder. Since I won't redistribute the menu scripts themselves, make sure that folder also contains the menu scripts (mmenudom.js, mmenuns4.js, milonic_src.js etc.). Open the menu.htm file and click the static links to try it out.

Dave, you might also be interested in a few other functions I'd been playing with in the mm_alwaysVisible.js file (open or close a menu while optionally toggling its alwaysvisible state, checking to see if a menu is open). You might also enjoy some playing I did with the test menu's header... adding a "close" button to the menu. It's currently commented out, 'cause it didn't work well in NS4 (surprise), but it was fine in the others. To try it, comment out the current header item (the first item) in the "references" menu, then uncomment the line below it.

Those who download the file but who aren't conversant with Javascript should be aware that, since I originally intended this only as a personal test of what I was doing at a time, the test page isn't fancy and there aren't any comments in the code or instructions on the test page as to how to use these functions. If anyone wants more direction, give a holler in this forum and, if I hear it, I'll be glad to provide some instruction.

Cheers,

Kevin


Poster: Hergio
Dated: Monday October 6 2003 - 2:18:55 BST

Ok great, then things must have changed slightly with the menu and/or you've figured out something I totally missed. But very cool either way. And I was in no way infringing on the coding abilities or testing practices of yourself. :D You are a tried programmer and we have come to expect that out of you, I was just making sure. ;)

I will take a look at the code, I would love to play around with it and see what fancy things one can get the menu to do and different ways to make it interact with users over and above just opening and closing. Nice job.


Poster: kevin3442
Dated: Monday October 6 2003 - 5:50:34 BST

Hey Dave,

Unfortunately, in my experience, "tried programmer" sometimes means something like, "Here is some code that I -- in my glory -- have deigned to write for you. Because of my vast knowledge, I know that this function will work, and have therefore not bothered to test it." We all know the common outcome of that one... and I confess to being guilty of it myself sometimes, so I don't really blame you for asking. I really was just kidding. ;) Let me know if you find anything interesting or anything that just plain s**ks.

Cheers,

Kevin


Poster: Maz
Dated: Monday October 6 2003 - 7:53:20 BST

Hi Kevin,

I appreciate you putting the code together, haven't had a chance to do anything yet, spent too much time trouble shooting Mac{ eI( 5.1.7 ) ;}

Hope the link remains active until I get to it,

Thank you,
maz