Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.

Does not close after clicking a link. #10

Closed
dkirjakov opened this issue Dec 14, 2012 · 9 comments
Closed

Does not close after clicking a link. #10

dkirjakov opened this issue Dec 14, 2012 · 9 comments

Comments

@dkirjakov
Copy link

I think im too stupid to get this FANTASTIC plugin to work correctly.
When i click on a link in the opened jPanelMenu-menu, the page jumps to the #id , but it does not close.
It opens and closes on .trigger and if you click into the jMenuPanel-panel.

Thanks to anybody who can help.

@besimhu
Copy link

besimhu commented Jan 27, 2013

I am having the exact same problem. I thought it was some option at some place, but it isn't.

Here is the site I am working on at the moment, http://playground.40digits.com/obm/
set the width to either tablet or mobile and the menu will change.

When you click on any of the anchor links, they don't close the menu at all. It will jump to the page, but menu still stays open. The jPanel site uses anchors to link on site elements too, so I dunno why mine would be any different.

Not using your minified version, as I had to comment out line 436
// if ( jP.menuIsOpen() ) jP.closeMenu(jP.options.animated);

and that has nothing to do with the problem, as it wasn't functioning even after install.

@dkirjakov
Copy link
Author

Thanks for giving me hope to solve this issue one day ;-) At the moment i have to use other techniques for mobile menu,though i’d love to use jpanelmenu.

I’ve send an Email to acolangelo and posted my issue here. No answer so far. Im glad im not the only one.Thought i was just too stupid to implement.

Nice approach btw, i like your site/Design :-)

So what are we doing wrong, why the menu is not working as it should?

@acolangelo
Copy link
Owner

The plugin is working exactly as designed. It was designed to handle only the creation and interaction of the menu/panel system, and provides an API object for custom interaction on the site.

To do what you're looking for, you'll need to create your own event listeners on the menu links and call the .close( ) API method. Check out the documentation for how that works: http://jpanelmenu.com/#api-close

@dkirjakov
Copy link
Author

Thank you very much!!! ;-)

Am 27.01.2013 um 14:03 schrieb Anthony Colangelo notifications@github.com:

The plugin is working exactly as designed. It was designed to handle only the creation and interaction of the menu/panel system, and provides an API object for custom interaction on the site.

To do what you're looking for, you'll need to create your own event listeners on the menu links and call the .close( ) API method. Check out the documentation for how that works: http://jpanelmenu.com/#api-close


Reply to this email directly or view it on GitHub.

@jcarrey
Copy link

jcarrey commented Apr 30, 2013

Closing with animations does not work on Android 5, had to remove the animations on closing for it to work properly, it kind of tries to close but the menu stays open.

If you using jquery mobile you need to modify the default container to :

$.mobile.changePage.defaults.pageContainer = $(".jPanelMenu-panel");

so it wont break your window.

@angaziz
Copy link

angaziz commented Oct 2, 2013

What about if I want the panel don't close when I click somewhere (except the menu (trigger button)) ? Thanks

@acolangelo
Copy link
Owner

@GieZ I think you may be looking for the option closeOnContentClick. Does that look like what you're looking for?

@angaziz
Copy link

angaziz commented Oct 2, 2013

@acolangelo Yes, thanks. I saw the documentation but I dont recognize that. LOL. thanks

@PJo777
Copy link

PJo777 commented Aug 8, 2014

Apparently the fix that the author put in ( closeOnContentClick) , closes the menu when someone clicks on the document-content ( not the menu-content). I wanted the menu to close when i click on one of the menu items.

This was a simple fix . I added the following inside the "initiateContentClickListeners" method. Works like a charm.

$('.menu-item').click(function(e)
{
if ( jP.menuIsOpen() ) jP.closeMenu(jP.options.animated);
})

Now the menu closes when you click on the page-content as well as the menu-link.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants