Scroll to top ionic


#1

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


#2

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


#3

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


#4

yes, thats exactly what i need. :smile:


#5

bengtler , just like the jefferycolbert post . :grin:


#6

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


#7

Ok Thanks man :smiley:


#8

you can simply try this with:
http://ionicframework.com/docs/api/service/$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


#9

ok i will try. Thanks for the help


#10

the scrollMainToTop() not working , here is my sample code , http://codepen.io/anon/pen/VLENgE


#11

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


#12

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:


#13

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


#14

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
#15

Updated the codepen with a floating button http://codepen.io/pliablepixels/pen/YXJbqM


#16

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


#17

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


#18

lol,your problem been solved ?


#19

Yup , here but, the button is not hiding when your at the top of the scroll bar … http://codepen.io/pliablepixels/pen/YXJbqM


#20

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: