Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

How to reset a "Scroll" element so it's scroll is reset to the top

Hi,

I have a scroll element (ionic project) that can contain variable amounts of data.

If the user scrolls using this scroll, then changes an option, so there is less data in the scroll, how do I reset the scroll so it's back to the top again?
At present it shows blank because I guess it's beyond the current data....

regards

Andy.

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

How to reset a "Scroll" element so it's scroll is reset to the top

no need, found this useful documentation on your site....

code
var $ionicScrollDelegate = Apperyio.get("$ionicScrollDelegate");
$ionicScrollDelegate.$getByHandle('mainScroll').scrollTop();
/code

works a treat !

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

How to reset a "Scroll" element so it's scroll is reset to the top

Hello Andy,

Glad to hear things are sorted out now!

Return to “Issues”