Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70764

Horizontal scrolling programmatically

$
0
0

@lsantaniello wrote:

Hi guys,
I have ion-scroll in my app and I’d like to scroll automatically when user trigger an event.

My code:

  <ion-toolbar>
    <ion-scroll scrollX="true" scrollY="false">
      <p *ngFor="let level of levels ; let i=index" [id]="level.id" (click)="changeTab(i,level)">
        {{level.label}}
      </p>
    </ion-scroll>
  </ion-toolbar>

levels in an array of level objects. it is an example:

{
  "id": x,
  "label": "abc"
}

When my page show I need to init my toolbar moving on exactly item.

I’d like center the item on the scrollbar, moving for example on the right.

Could you please help me?

Thanks
Luca

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70764

Trending Articles