inuyaksa / jquery.nicescroll

nicescroll plugin for jquery - scrollbars like iphone/ipad
https://nicescroll.areaaperta.com/
3.6k stars 1.67k forks source link

Scroll not work on chrome mobile #756

Open xcesaralejandro opened 6 years ago

xcesaralejandro commented 6 years ago

The scroll is not working on the materializecss framework cards on mobile devices.

Version chrome mobile: 67.0.3396.68 SO: android 8.1.0; pixel xl

I also checked in the desktop version in "responsive" mode (google chrome Versión 66.0.3359.181 (Build oficial) (64 bits)) and the scroll does not work either. I have deactivated his library and everything goes perfectly.

shurfee commented 6 years ago

The same issue with horizontal scroll on mobile devices. Chrome, android 8.0.

On desktop browser swipe is working, in responsive mode too. Maybe we should add additional option to slider settings? From description I thought that mobile scroll should work out of the box.

xcesaralejandro commented 6 years ago

Finalmente he tenido que deshabilitar la carga en dispositivos móviles, no es la mejor, no es la más eficiente y tampoco tiene total compatibilidad al reconocer el dispositivo, pero funciona con la mayoría. Les comparto las lineas de código para utilizar como solución temporal.

var isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent); if (!isMobile) { $("body").niceScroll(options_scroll) }

nmaokafor commented 4 years ago

Here is the fix for this issue that worked for me.

When you call the niceScroll function $("body").niceScroll(); in your javascript class, it appears to add an inline style of: overflow-y: visible on your body element (because it is inline, it overrides any previous overflow: hidden that you may have written in your css file.

Simply addoverflow: hidden ! important in the css of your body element.

Also, make sure that your html element has style of

overflow: hidden;
touch-action: none;