jInvertScroll icon indicating copy to clipboard operation
jInvertScroll copied to clipboard

How to fix on mobile ?

Open ryantran opened this issue 9 years ago • 9 comments

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 ?

ryantran avatar May 29 '15 09:05 ryantran

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

sakshamsaxena avatar Jun 10 '15 09:06 sakshamsaxena

@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

JimmyBillan avatar Jun 14 '16 07:06 JimmyBillan

@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 avatar Jun 16 '16 19:06 grahamd711

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" />

grahamd711 avatar Jun 16 '16 19:06 grahamd711

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.

ConnerKeating avatar Jun 10 '19 18:06 ConnerKeating

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.

pixxelfactory avatar Jun 11 '19 06:06 pixxelfactory

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

ConnerKeating avatar Jun 11 '19 17:06 ConnerKeating

Wondering if anyone ever came up with solutions here?

willtate avatar Sep 17 '19 19:09 willtate

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.

akasunil avatar Oct 08 '20 09:10 akasunil