Scroll to top ionic


Is there any new update for the scroll to top in ionic?


you click on the title-bar and the view is scrolled to top?
or what do you mean?


Days ago, I made this function in my app,this is a gif bellow,Is this you want?


yes, thats exactly what i need. :smile:


bengtler , just like the jefferycolbert post . :grin:


Oh, But I wrote this tutorial in Chinese , Maybe tomorrow I can find a example for you. :smile:


Ok Thanks man :smiley:


you can simply try this with:$ionicScrollDelegate/

There you have the functions with scrollTop and scrollBottom

First --> add a button to your headerbar or in the footer -_> if you click it, call scrollTop

After that you can build an own directive where you can add a listener on scroll --> and every time you are scrolling --> check the scrollposition if you are out of a defined range --> show the button


ok i will try. Thanks for the help


the scrollMainToTop() not working , here is my sample code ,


You have another scroll-handler (small) inside of the main delegate which is where the list is scrolling. So you need to use that handle


oh, i see , thanks pilablepixels :smile: , the scroll to top is now solved but i have one more question , did you see the image jeffreycolbert , I’d like to make a button that wll show if your in the bottom of scroll, and when you click that button it will scroll to top, can you help me with that ? Thanks in advance :grinning:


i ugly positionated a button absolut at the bottom of the list ^^


bengtler , The scroll to top was solved by I have one more problem , How Can I Hide the button if your in the top of the list , and show the button if your in the bottom of the list. Can you help me with this ? THanks in Advance :grinning:

Scrolling position to top on button click

Updated the codepen with a floating button


yeah here a directive for that you can fix the styling… for that i have no time :slight_smile:


Wow, This is what i need, Thanks for the help , bengtler and pilablepixels :smile:


lol,your problem been solved ?


Yup , here but, the button is not hiding when your at the top of the scroll bar …


Don’t worry, you can link the jQuery.js into your project and use fade In and fade out to controll the button class. :blush: