Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) Add mousewheel support #244

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

derdritte
Copy link

To let mouse-wheel events change the current picture to the previous or next picture:

baguetteBox.run('.gallery', {
    'handleWheel': true
});

Default is false, that seemed appropriate to me.

The current implementation prevents default and, to avoid having to restructure when (user)options are loaded, the event-handler is always added to the overlay and the event-handler will check the option on each event. Naturally this is not ideal, but didn't think adding this small feature warranted that level of refactoring. I am not a JS-dev, any input is appreciated.

An (additional) option to allow inverting of the directions the scroll-events get translated to can be added easily, if desired.
I also read the contribution guidelines, but opening a ticket for such a minimal change seemed overkill, if the feature isn't welcome or relevant, the PR can be closed. If you want the discussion anyway, I'd be happy to open an issue.

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

Successfully merging this pull request may close these issues.

None yet

1 participant