1

enter image description hereI want to use scrollToTop in my ionic project . In my code scrollToTop working but i am want to show button when scroll the content in ionic . How to show sticky button in ionic please help me... In images my button show at end want to show at middle and show when i am scrolling..

tab1.page.html

        <ion-content cache-view="false" (ionScrollStart)="logScrollStart()" (ionScroll)="logScrolling($event)"
          (ionScrollEnd)="logScrollEnd()" [scrollEvents]="true">
        <button class="scroll"  (click)="ScrollToTop()">
              <ion-icon name="arrow-dropup-circle"></ion-icon>
            </button>
            </ion-content>

tab1.page.ts

ScrollToTop(){
    this.content.scrollToTop(1500);
  }
Dinesh Vishwakarma
  • 656
  • 3
  • 13
  • 34

1 Answers1

1

For the "when I'm scrolling", you can detect if your heart icon is visible in your scroll-able card with something like:

How to Check if element is visible after scrolling?

Cyril Hanquez
  • 686
  • 3
  • 6