d4nyll / smartscroll

jQuery plugin for scrolljacking and auto-hashing

Home Page:https://d4nyll.github.io/smartscroll/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scrolling by sections is not working on touch devices

tribou opened this issue · comments

Is this plugin supposed to work on an iPad or any touchscreen device? The examples weren't working on any of my touchscreen devices.

@tribou Touch support was implemented with commit 99b9df7. This change is not yet reflected in the demo because I am currently redoing the entire demo (mostly to improve the look)

If you use the latest version (2.4.0), it should work on touchscreen devices.

Thanks for checking it out, if you have an issues, feel free to message me back!

Hi @d4nyll ,

Great plugin!
I have copied the smartscroll.min.js from the master branche and added it to my site
http://vagari.rbijker.com/

It works fine on desktop but it doesnt seem to work on mobile (I tested it on iPhone Safari and Android Chrome). I also included lethargy.min.js.

Should this last version work on mobile? Am I missing something?

Thanks!

@rbijkercom Can you post your configurations?

Also, can you make sure the following options are enabled:

  • eventEmitter - (Object) If you pass in an EventEmitter object, autoHashing will be much more efficient. You can also listen to the scroll events this way. Defaults to null.
  • bindSwipe - (Boolean) Allow for listening of swipe events. Requires EventEmitter. Defaults to true

Hi @d4nyll

This is my configuration:

 var options = {
    mode: "set",
    autoHash: false,
    sectionScroll: true,
    initialScroll: true,
    keepHistory: false,
    sectionWrapperSelector: ".scroll-wrapper",
    sectionClass: "scroll-section",
    animationSpeed: 1200,
    headerHash: "header",
    breakpoint: null,
    eventEmitter: null,
    dynamicHeight: true
  };
  $.smartscroll(options);

ps. when I check your demo pages on mobile it doesnt work either. 🤔 Should they be working?

Thanks for your help!

Just checked my code again. Right now, for mobile, smartscroll will emit events to say "this is a swipe down action" but it won't actually scroll. This was because 1) I don't have time to refactor the code to update 2) I really believe that it is very bad for user experience to hijack the viewer's scroll, especially on mobile.

If you want to use smartscroll, fork the repo and change this block in a similar way to options.bindKeyboard. You can copy and paste the most of the block and change just the case 38: and case 40: conditionals.

Thank you for the hints. I got it to work, but like you said, it's not optimal for mobile. It stutters a bit and it doesn't always scrolls to the correct section. Thanks anyway and keep up the good work!

@rbijkercom Thanks! All the best with your project!