안드로이드 2.3 이하에서만 동작하도록 하자.
(function(android23Div) {
    var startPos = null;
    var startScr = null;
    var edgeCheck = false;

    jindo.$Fn(function(oEvent) {
        var touch = oEvent.$value().touches[0];
        startPos = [ touch.pageX, touch.pageY ];
        startScr = [ android23Div.scrollLeft, android23Div.scrollTop ];
        edgeCheck = true;
    }).attach(android23Div, 'touchstart');

    jindo.$Fn(function(oEvent) {
        if (!startPos) { return; }
        var touch = oEvent.$value().touches[0];
        var before = [ android23Div.scrollLeft, android23Div.scrollTop ];
        android23Div.scrollLeft = startScr[0] + startPos[0] - touch.pageX;
        android23Div.scrollTop = startScr[1] + startPos[1] - touch.pageY;
        if (edgeCheck && before[0] === android23Div.scrollLeft && before[1] === android23Div.scrollTop) {
            startPos = null;
            return;
        }
        edgeCheck = false;
        oEvent.stop();
    }).attach(android23Div, 'touchmove');

    jindo.$Fn(function(oEvent) {
        if (!startPos) { return; }
        startPos = null;
    }).attach(android23Div, 'touchend');

})(jindo.$('android23Div'));

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-1) was last changed on 19-May-2014 18:22 by DongGukLee