Close submenu after mouse click

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
beerens
Beginner
Beginner
Posts: 6
Joined: Wed Feb 08, 2006 8:34 pm

Close submenu after mouse click

Post by beerens »

Hello,

I have a website with a horizontal menu and some vertical submenu's. -see also http://www.antonbeerens.e-hosted.nl/index.php

The page uses a Iframe for the content. At the moment after I click on a submenu the page is loaded into the Iframe but the submenu stays open. Is it possible to automatically close it after a mouse click?

It is just a minor issue and I am very happy with the menu!

Kind regards,
Anton Beerens
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi


When I started your page

http://www.antonbeerens.e-hosted.nl/index.php

it was impossible for me in IE 6.2 to keep a sub open, even the second level subs closed, when the mouse pointer left the menu.

However, in FF 1.5 I confirm, some subs closed only, when I clicked outside the iframe area. It seems to be an "old" FF bug. As far as I know it is not a matter of the menu. Mail to FF !!!

This is not to discourage or to frustrate, but - if possible - try to open your page with OPERA 8, the submenus are even not visible there. We have to wait for Opera 9, (as far as I´know, it will be improved there).

Did not test any other browser.

Michael

Please see
http://milonic.com/itemproperties.php
"closeonclick"
Last edited by Migru on Thu Feb 09, 2006 4:19 pm, edited 1 time in total.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

You also need to upgrade to the newest version, 5.742.

Ruth
beerens
Beginner
Beginner
Posts: 6
Joined: Wed Feb 08, 2006 8:34 pm

Post by beerens »

Thank you for the replies. I have checked but when I click on the link it opens the site correctly. I have no idea what is going wrong.

I will update the menu to the latest version and play with the closeonclick funtion. I am sure I will be able to solve it now.

Kind regards,
Anton Beerens
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

:oops: Sorry, that's my fault, I noted the problem and edited the link, it was the period and ) after it that was acting like part of the link.

Ruth
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi again

The drawMenus() should be the final statement of the main_menu script section, and the home sub should be included in the menu_data.js.
This possibly could improve your closemenu - performance.
The drawMenus() then, within own <script> tags would be unnecessary.

Michael
beerens
Beginner
Beginner
Posts: 6
Joined: Wed Feb 08, 2006 8:34 pm

Post by beerens »

Hi,

I have tried the following without any succes.

- Updated to 5.742
- Tried to set closeonclick=true
- Tried to use closeallonclick=true
- Tried Openonclick=true and that worked. Now I had to click on a menu item before the submenu was opened...

Neither of them will close the submenu when I click on it. I have searched the forum but it seems to be a known problem when using IFrames.

@ Migru The home submenu is made with a piece of PHP code. This to show a login or logout menu. That is why the menu part is broken into three script parts. But I tried to remove the php code and still no luck.

One person seemed to get it to work viewtopic. ... oseonclick will try this tomorrow or maybe someone else know something else to try.

Kind regards,
Anton Beerens
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi

Well, we should distinguish between this actual issue and the discussion we had before FF 1.5 was introduced.
Before FF 1.5. it was worse than it seems to be actually, because for instance the melonic sample page

http://milonic.com/menusample.php?sampleid=11

had obviously that problem too and in fact I´m unable to reproduce it there now.

I´m using IFRAMES and a horizontal menu bar in a table cell, with vertical submenus similar like you do (not php), just on top of such an inline frame. - and have the problem with OPERA as everyone has using iframes. (That was for me the reason for an additional treemenu in my dhyg-pages)

http://www.dhyg.de/

but with FF 1.07 I had the problems, see the discussion/posts:

http://milonic.com/forum/viewtopic. ... ght=#32953

particularly the final post there! But after those posts/discussion everyone considered this as solved with the installation of FF 1.5. And for me, it is the main reason, that, whatever (in html pages, JavaScript) deviates from standard recommended settings (i.e. placement of drawMenus(), arrangement of referencing of files etc. and such things) then of course makes me suspicious... and it seems to be very certain, that in this regard, there is not much space for experiments.


Michael
beerens
Beginner
Beginner
Posts: 6
Joined: Wed Feb 08, 2006 8:34 pm

Post by beerens »

Hi,

I am not sure if I have explained my problem properly. In the example : http://milonic.com/menusample.php?sampleid=11 if I click on "Links opened in IFrame" and then on any of the submenu's the content is loaded into the IFrame. However after I have clicked on the submenu (ea "Apache web server") I want the menu to be closed. Now I have to move the mouse away from the menu before it will be closed.

My menu does exactly the same as yours on your site. It stays down after a mouse click :) Still thanks for your reply.

Kind regards
Anton Beerens
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi, good morning

OK got it. It should immediately close after the mouseclick.

M.


but my observations in your menu are e.g.

hover Sponsoren (Main) and click
again Sponsoren (in the sub) then
Sponsor commissie

repeat

the menu not always closes, when leaving it. (FF only)
Is this only in my browser - installation here ??

Michael
beerens
Beginner
Beginner
Posts: 6
Joined: Wed Feb 08, 2006 8:34 pm

Post by beerens »

Hmm that is something I haven't checked in FF. Lucky enough most of my visitors are IE, but I will check it.

Thanks!
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi there

stunning, and again noticing that the correct communication is of vital importance! There was obviously a misunderstanding in the beginning.

So far, I´ve considered the "closeonclick" problem as the minor issue, whereas I considered the -not-closing-when-leaving-the-menu- as the major problem !

(This is because originally FF didn´t close at all in version 1.02, when iframes were in the game)

Michael
beerens
Beginner
Beginner
Posts: 6
Joined: Wed Feb 08, 2006 8:34 pm

Post by beerens »

I agree communicatation is very important with such matters. What is clear for me does not mean is is clear for everyone else :) sorry about that.

Hmm sounds like a big issue the menu's that does not close at all. Maybe a stupid question but has anyone tried to make a workaround with some javascript? I assume the onclick on the page can be triggered and in that event call the closeAllMenus() ??

Anton
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Anton,

i will take it up on the agenda very soon, at the moment I´m busy with some other issues.

(I think I will request Milonic for support)
By the way, and as you are using iframes, look at

http://milonic.com/forum/viewtopic.php?t=7137
(first post)

Michael
Post Reply