Page 1 of 1

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

Posted: Wed Jun 27, 2018 3:11 pm
by Andy Parker

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.


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

Posted: Wed Jun 27, 2018 3:23 pm
by Andy Parker

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

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

works a treat !


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

Posted: Wed Jun 27, 2018 6:49 pm
by Serhii Kulibaba

Hello Andy,

Glad to hear things are sorted out now!