pixxelfactory / jInvertScroll

A lightweight jQuery vertical scroll - horizontal move plugin with parallax effect.
http://www.pixxelfactory.net/jInvertScroll
MIT License
786 stars 156 forks source link

How to fix on mobile ? #19

Open ryantran opened 9 years ago

ryantran commented 9 years ago

I really love this jquery plugin and i used it for my website. But, when i test on mobile, it is wrong way up. When i swipe down, it scrolls up => screen scroll left. Beside, if when swipe right, can it scroll right ?

sakshamsaxena commented 9 years ago

@ryantran You need to be more specific, and if possible, provide with a snippet.

JimmyBillan commented 8 years ago

@ryantran Don't forget to set the viewport on mobile <meta name="viewport" content="width=device-width, user-scalable=no"> otherwise the body tag will be bigger than you screen

grahamd711 commented 8 years ago

@pixxelfactory @JimmyBillan, is it possible to disable the scroll down and implement a swipe right type functionality? This way the user could swipe left or right instead of having to scroll down?

grahamd711 commented 8 years ago

I tried what @JimmyBillan suggested to set the viewport on mobile and also the below meta tag. I still am able to scroll horizontally however.

<meta name="viewport" content="width=device-width; initial-scale = 1.0; maximum-scale=1.0; user-scalable=no" />

ConnerKeating commented 5 years ago

Trying to implement invertscroll, but I'm running into this issue. Since it utilizes an up-and-down scroll to go sideways, it does the same on mobile. On mobile you have to swipe up and down to go left and right. Is it possible to fix this.

pixxelfactory commented 5 years ago

Hmmm.. one possibility would be to implement a routine that detects if the user is on a mobile device (or differ between click and touchstart when scrolling) and write a function or whatever that does not set the full height, but the width and update the positions of the elements when scrolling to left / right.. Not a simple thing to do, but i'll look into that.

ConnerKeating commented 5 years ago

Thank you, I'll certainly toy around with it as well

willtate commented 5 years ago

Wondering if anyone ever came up with solutions here?

akasunil commented 4 years ago

there is an error in the jquery file

// do the position calculation for each element

$.each(elements, function (i, el) { var pos = Math.floor((el.width - winWidth) scrollPercent) -1; el.el.css('left', pos); });

here scrollPercent should be increased more than 1.