Closing when Menu behavior: On click

Replied by almooj-craig on topic Closing when Menu behavior: On click

Posted 11 years 7 months ago #6017
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:11 years 7 months ago by almooj-craig
Last edit: 11 years 7 months ago by almooj-craig.
The following user(s) said Thank You: Montimontt

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

Replied by ced1870 on topic Closing when Menu behavior: On click

Posted 11 years 7 months ago #6023

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

by ced1870

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

Replied by ced1870 on topic Closing when Menu behavior: On click

Posted 11 years 7 months ago #6024

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

by ced1870

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

Replied by Montimontt on topic Closing when Menu behavior: On click

Posted 11 years 7 months ago #6026
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.

Replied by ced1870 on topic Closing when Menu behavior: On click

Posted 11 years 7 months ago #6027

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

by ced1870

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

Replied by Montimontt on topic Closing when Menu behavior: On click

Posted 11 years 7 months ago #6034
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:11 years 7 months ago by Montimontt
Last edit: 11 years 7 months ago by Montimontt.

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

Time to create page: 0.708 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 1185 guests and no members online