Comments (8)
I commented the function call stopEventPropagation(e) in function itemAnchorClick.
Now I can click, but I don't know this is a correct thing to do...
from multi-level-push-menu.
Hi,
Each event triggers a callback, so I would rather suggest using event callback functionality, as follows.
$( '#menu' ).multilevelpushmenu({
onItemClick: function() {
// First argument is original event object
var event = arguments[0],
// Second argument is menu level object containing clicked item (<div> element)
$menuLevelHolder = arguments[1],
// Third argument is clicked item (<li> element)
$item = arguments[2],
// Fourth argument is instance settings/options object
options = arguments[3];
// You can do some cool stuff here before
// redirecting to href location
// like logging the event or even
// adding some parameters to href, etc...
// Anchor href
var itemHref = $item.find( 'a:first' ).attr( 'href' );
// Redirecting the page
location.href = itemHref;
}
});
If you don't need callback functionality you can comment function call stopEventPropagation(e), as you already did.
from multi-level-push-menu.
Ok thank you. Your suggestion is clearly better. Why isn't it a default setting ?
from multi-level-push-menu.
Can you please describe your suggestion more in details so I could consider its implementation for next release?
from multi-level-push-menu.
For example :
add a setting : redirectOnClick => true or false
add an anonymous function which would execute the code you gave me above when redirectOnClick is set to TRUE.
from multi-level-push-menu.
New milestone set - adding [option] in [v2.0.6] Prevent default event for item click.
from multi-level-push-menu.
Dude, you da man! Developing my first site and I very much appreciate this library as well as your fantastic documentation!
from multi-level-push-menu.
@adgsm Thanks, it's working for me.
from multi-level-push-menu.
Related Issues (20)
- Sorting HOT 4
- Problem with scrolling on Mobile device ( Android 6) HOT 3
- External button HOT 2
- Back text as a parent HOT 1
- Custom data through feed HOT 2
- Smooth scrolling on iOS Devices
- Show menu top upon clicking a menu item that has sub menu items under it HOT 2
- Auto expand or open specific child menu when loading a section HOT 1
- How to get menu level on 'onExpandMenuStart' and 'onCollapseMenuStart'? HOT 1
- Reverse sliding direction HOT 1
- move menu icon out of h2 tags and let it trigger the menu HOT 34
- Expanding to a level object when more than one have the same name HOT 2
- Blank menu during slide over animation HOT 1
- Remove all Menu items
- open menu @ media query
- Resize menu width automatically HOT 1
- fill data dynamic
- Add other element inside list tag HOT 1
- [Feature Helper ] JS Array Helper
- I cannot Scroll
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multi-level-push-menu.