4

I updated my Ionic 3 project to Ionic 4 and since then my slider first loads slide with index 0 and after some seconds it loads the initial slide. Is there a solution for this problem?

This is my HTML


    <ion-slides [options]="slideOpts" (ionSlideDidChange)="slideDidChange()" #myslides style="height:100%; width:100%;">
        <ion-slide>
            <app-noticed-events style="height:100%; width:100%;"></app-noticed-events>
        </ion-slide>
        <ion-slide>
            <app-home style="height:100%; width:100%;"></app-home>
        </ion-slide>
        <ion-slide>
          <app-map style="height:100%; width:100%;"></app-map>
        </ion-slide>
      </ion-slides>

This is my TS-Code

slideOpts = {initialSlide:1, zoom: false}

Could lazyloading be the problem?

saibot
  • 331
  • 2
  • 13

1 Answers1

0

have you tryed setting it like this ?

.html

 <ion-slides pager="true" [options]="slideOpts">
      <ion-slide>
        <h1>Slide 1</h1>
      </ion-slide>
      <ion-slide>
        <h1>Slide 2</h1>
      </ion-slide>
      <ion-slide>
        <h1>Slide 3</h1>
      </ion-slide>
    </ion-slides>

.ts

 slideOpts = {
    initialSlide: 2
  };

all the options are here http://idangero.us/swiper/api/

Ira Watt
  • 2,095
  • 2
  • 15
  • 24
  • This is my HTML ` ` This is my TS-Code `slideOpts = {initialSlide:1, zoom: false}` But still get a delay – saibot May 11 '19 at 09:35