195
rated 0 times
[
196]
[
1]
/ answers: 1 / hits: 30618
/ 11 Years ago, mon, october 21, 2013, 12:00:00
I have a PhoneGap application that when it opens an HTML page, I want it to scroll to a specific <div>
element. So far I've been able to make it do that with this script using jQuery:
<script>
$(document).delegate('.ui-page', 'pageshow', function () {
var offset = $(this).find('#timeindicatordiv').offset().top;
setTimeout(function () {
$.mobile.silentScroll(offset);
}, 0);
});
</script>
This only gives me a jump directly to the <div>
which looks a bit choppy.
Is there any way to give this a smooth animation?
More From » jquery