Rodrigo Parra
Rodrigo Parra

Reputation: 243

iScroll not scrolling on iPhone

I'm developing a phonegap app and trying to use iScroll 4 for scrolling on my pages. It works fine on web, but when I test on device/simulator the scroll doesn't work smoothly. When I touch the device screen it already click on my li element, and if I scroll down it doesn't look like an scroller.

Here's the script that I've take form iScroll website:

function onDeviceReady(){

var myScroll;
    function loaded() {
       myScroll = new iScroll('wrapper');
    }

    document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);

    document.addEventListener('DOMContentLoaded', function () { setTimeout(loaded, 200); }, false);

    document.addEventListener('DOMContentLoaded', loaded, false);


}

and here's how my list style looks like:

<div id="wrapper">
<div id="scroller">

            <ul id="thelist">
                <li>
                    <div class="item">
                        <div class="arrow"></div>
                        <div class="score"><a href="#">98 <span>score</span></a></div>
                        <div class="job-title">Expert UI/UX Designer</div>
                        <div class="detail">
                            at <span>Hewlett Packpard</span> - 30 connections
                        </div>
                        <div>
                            <a href="#" class="button-arrow"></a>
                        </div>
                    </div>
                </li>
            </ul>
    </div>
</div>

I think everything is right, take a look at the live page: http://rodrigoparra.com/bright/pages/dashboard.html

and here a sample of iScroll on the same app: http://rodrigoparra.com/bright/simple/index.html

If you test on your device, you will see the first one doesn't work and second one works fine. Not sure what is wrong :\

Any ideas of how I could fix it?

Thanks Guys

Upvotes: 0

Views: 2061

Answers (1)

kb920
kb920

Reputation: 3089

Hi as per my knowledge you need to set your scroll view content size.

Upvotes: 2

Related Questions