darsain / sly

JavaScript library for one-directional scrolling with item based navigation support.
http://darsa.in/sly
2.87k stars 497 forks source link

Phonegap iOS Slide not working #240

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hello, thank you for this library. Like it very much. Works in browser and Android (Phonegap).

But in iOS this does not slide, always shows the first item.

Line 445

`// If first render call, wait for next animationFrame

        if (!renderID) {
            renderID = rAF(render);
            if (dragging.released) {
                trigger('moveStart');
            }
            return;
        }`

On button click function render() is activated 2 times. First time it enters this IF (gets renderID), and second time it must continue without entering this IF, but in iOS it always does because renderID is always undefined.

Have tried to replace Line 18 with: (like in this post) var rAF = function( callback ){ w.setTimeout(callback, 1000 / 60); }; no result..

Any help would be appreciated. Thanks

ghost commented 8 years ago

Found solution:

Before IF statement insert next line: renderID = !renderID ? 23 : renderID; //23 can be any number