Bounce on overflow set to auto or scroll in WP8 WebBrowser control

I know this is a duplicate with this post, but there was no acceptable solution. Genuine Windows Phone Webbrowser Behavior

"- ms-touch-action: none;" It works smoothly, using an element has an overflow style with the value auto or scroll. after the contents scroll up or down. if I take my finger back and forth and continue scrolling, the page bounces with my finger.

this problem will only occur in the control, and not in the system browser, so I think that they should be a solution anyway?

Anyone get a solution?

+3
source share
1 answer

Update

, , ! , ? , .

, , WP7 , , WP8 ( WP7).

, , . , -- , , .

, , . .

# ( LinqToVisualTree.cs

private void mainBrowser_Loaded(object sender, RoutedEventArgs e) {
    var border = mainBrowser.Descendants<Border>().Last() as Border;
    border.ManipulationDelta += border_ManipulationDelta;
    border.ManipulationCompleted += border_ManipulationCompleted;
}

void border_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) {
    mainBrowser.InvokeScript("onmanipulationcompleted");
}

void border_ManipulationDelta(object sender, ManipulationDeltaEventArgs e) {
    var status = mainBrowser.InvokeScript("onmanipulationdelta") as string;
    if (status == "top" || status == "both") {
        if (e.DeltaManipulation.Translation.Y > 0) {
            e.Handled = true;
        }
    }
    if (status == "bottom" || status == "both") {
        if (e.DeltaManipulation.Translation.Y < 0) {
            e.Handled = true;
        }
    }
}

JS

window.manipulationTarget = null;

window.onmanipulationdelta = function () {
    if (!window.manipulationTarget) {
        return '';
    }

    var target = window.manipulationTarget;

    var top = target.scrollTop == 0;
    var bottom = target.scrollTop + target.clientHeight == target.scrollHeight;

    return top ? bottom ? 'both' : 'top': bottom ? 'bottom' : '';
};

window.onmanipulationcompleted = function () {
    window.manipulationTarget = null;
};

// and you'll need to make calls to every elements
// with overflow auto or scroll with this:
function preventBouncing(ele) {
    // using jQuery.
    ele.on('MSPointerDown pointerdown', function (e) {
        window.manipulationTarget = this;
    });
}

, . , ~

+5

All Articles