-
Notifications
You must be signed in to change notification settings - Fork 140
Ignore events handled by other listeners #40
base: master
Are you sure you want to change the base?
Conversation
|
You should just |
|
Good point, however, this may be a problem if you are using third-party code (in my case http://getbootstrap.com/javascript/#carousel) that call event.preventDefault() for handled events. I guess one could add an event listener that gets triggered between the carousel and skrollr-menu, but that does not seem ideal. Would it be acceptable if I made it configurable? I.e. skrollr.menu.init({
ignoreDefaultPrevented: true | false
})or a more general version skrollr.menu.init({
handleClick: function(event) {
if (/* I want this event to be handled by skrollr-menu */) {
return true;
}
return false;
}
}) |
|
We should probably handle this in some way or another, but can't you just use a |
|
I hadn't thought of that, using a button will solve the issue for my current project, thanks for the tip. I guess most cases can solved be this way. Although, I still think it will be useful to support defaultPrevented in some way, it is not critical. |
|
I would love this so much right about now :D |
What is your use case? There is probably a workaround. |
|
Also, it seems to disregard |
they should both be ignored by skrollr-menu completely (https://github.com/Prinzhorn/skrollr-menu/blob/master/src/skrollr.menu.js#L71). If not, please create a demo on jsbin.com |
Avoid scrolling if link is used by a third-party. E.g. if I use Twitter Bootstrap with the carousel-component in to show images, I do not want my page to start scrolling when users click next/prev.
Related to Prinzhorn/skrollr#474