Closing when Menu behavior: On click

More
14 years 1 month ago - 14 years 1 month ago #6017 by almooj-craig
Take a look at your template and find one of the main divs that has an id. For example lets say it's something like. <div id="wrapper">

Then change the original code from the mian js file
Code:
if (ismobile) { $(document.body).addEvent('click',function(e) { if(element && !e.target || !$(e.target).getParents().contains(element)) { el.hasBeenClicked = false; el.hideMaxiCK(); } }); }
to something like:
Code:
if (ismobile) { document.getElementById('wrapper').addEvent('click',function(e) { if(element && !e.target || !$(e.target).getParents().contains(element)) { el.hasBeenClicked = false; el.hideMaxiCK(); } }); }
and it should work correctly because ipad and ipod just ignore the click events for document and document.body unless you click on a link or form input element. By assigning the click event directly to one of your divs then you avoid that problem.
Last edit: 14 years 1 month ago by almooj-craig.
The following user(s) said Thank You: Montimontt

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #6023 by ced1870

1. I have an iPad now and tested jommlack.fr: klicking outside of the menu to close it does not work with safari.

yes because I have not yet implemented it on my website ;)

I will try to see this in the next days, but for now I have other things to work on
Ced

Joomlack Webmaster and Developer

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #6024 by ced1870

Is there a way to let the menu close by clicking anywhere but on the link or the menu (click outside)?

this is your first post

I don't want the main-menu-link (first level) to load anything, but only to open (or close) the menu

this is your las post

so I think you have changed your mind in the way to use the menu on ipad ?

Joomlack Webmaster and Developer

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #6026 by Montimontt
Hi, sorry, I don't see a differenz. Maybe because my enlgish is too bad.

I have not change my mind. I will try to explane it again.

PC: mouseover main-menu-link: open; klick on main-menu-link: no action
iPad: klick on the main-menu-link: open, no other action; klick ouside the open menu: close menu

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #6027 by ced1870

PC: mouseover main-menu-link: open; klick on main-menu-link: no action

ok so use a separator item type, not a link

then I have understand that it seems to be a problem with the ipad on body click, and I will see as soon as possible
Ced

Joomlack Webmaster and Developer

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago - 14 years 1 month ago #6034 by Montimontt
Ok I tried to do so and tested about 3 hours now :blink:

There are some problems so I can't use a separator:
- level 1 has to be a component, when I put the component-link on level 2, I have problems with the URL like:
/network/network/...
- If a create a a shadow-menu for the main-menu (I don't know how it's called in english), I have problem with menu-effects and more.

So I decited to see the point "clicking-on-menu-link-loads-other-site" no longer as a problem :) It was more a problem for iPad anyway.

But I would be very happy if you could look further after the ipad-on-body-click-thing! I am still looking for a solution on:
"iPad: click on the main-menu-link: open, no other action; click outside the open menu: close menu"

Maybe there is a way for iPad to set like "iPad: click on the main-menu-link: open/(close), no other action", almooj-craig?


Thanks so much, realy!
Last edit: 14 years 1 month ago by Montimontt.

Please Log in or Create an account to join the conversation.

Time to create page: 0.203 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 4942 guests and no members online