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

PreventDefault on disabled i.e. vertical scrolling disables touch #63

Open
asdf09876 opened this issue Feb 24, 2016 · 0 comments
Open

Comments

@asdf09876
Copy link

Our case:
We have some sections on a page. One section uses enscroll to simulate a horizonatl "slide" of a bigger image on mobile. So the section has a width of 100%. We disabled verticalScrolling for enscroll. The effect is, that the user cannot scroll furthermore to the sections after the described section.

Our fix in your script for the touchStart function:
1.: added variable settings:
touchStart = function( event ) {
var touchX, touchY, touchAxis, touchX0, touchY0, touchStarted, touchDelta,
pane = this,
settings = $( pane ).data( 'enscroll' ).settings,

2.: added condition around the preventDefault function call:
if ((touchAxis === 'y' && settings.verticalScrolling) || (touchAxis === 'x' && settings.horizontalScrolling)) {
preventDefault( event );
}

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

No branches or pull requests

1 participant