magnetic scroll?

29 views
Skip to first unread message

Sylvain Berthu

unread,
Feb 12, 2016, 10:12:26 AM2/12/16
to iScroll
has your iScroll a magnetic feature?
I explain:My page is a tall lift and we use the iScroll js to change for stair.
But, for now, it is possible to stop the lift between 2 stairs and it's very ... dangerous!!
No, just to imitate mobile phone, is it possible to add magnetic feature to iScroll and force the scroll to stop on anchors and never between two (for H and V scroll!)
thx!

David Webb

unread,
Feb 24, 2016, 5:42:26 PM2/24/16
to iScroll
I believe the feature you're looking for is called "SNAP". You can include it as a boolean in your options.

    myScroll = new IScroll('#wrapper', {
        scrollX: true,
        scrollY: false,
        momentum: false,
        bounce: true,
        snap: true,
        snapSpeed: 800,
        keyBindings: true
    });

Remember you must use the full iScroll JS file, not the iScroll-Lite variety.
Reply all
Reply to author
Forward
0 new messages