ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

How to create multiple instance on ion-slide in single view.

Open kamote opened this issue 12 years ago • 5 comments

<ion-slide-box on-slide-changed="slideHasChanged($index)">
  <ion-slide>
    ....1
  </ion-slide>
  <ion-slide>
   ....2
  </ion-slide>
</ion-slide-box>

<ion-slide-box on-slide-changed="slideHasChanged($index)">
  <ion-slide>
    ....Another slide
  </ion-slide>
  <ion-slide>
   ....Another slide
  </ion-slide>
</ion-slide-box>

using that code the content view does not scroll

kamote avatar Oct 01 '14 09:10 kamote

Hey @kamote - you can do this by isolating each slidebox in it's own controller. See this codepen for an example.

Is this what you are trying to do?

drewrygh avatar Oct 01 '14 22:10 drewrygh

It only work when the height of slides are small or else not all slides are displaying. I tried to wrap every slides with ion-scroll now I can scroll to the content.

kamote avatar Oct 02 '14 02:10 kamote

I see. So did adding <ion-scroll> fix the problem? Are you trying to scroll through a list of slideboxes? Or do you want to be able to scroll through the content inside of a slidebox (with a large height)?

drewrygh avatar Oct 03 '14 22:10 drewrygh

Yes, I was trying to put multiple slidebox..Putting them inside an ion-content fixed the problem.

<ion-view hide-nav-bar="true">
<ion-content scrollbar-y="false" has-bouncing="true" class="discover">
  <ion-slide-box show-pager="false" on-slide-changed="firstSlideChanged(index)" 
    class=""> ...
  <ion-slide-box show-pager="false" on-slide-changed="secondeSlideChanged(index)" 
    class=""> ...

kamote avatar Oct 07 '14 09:10 kamote

is this correct ? creating multiple controller ? what if i have 8-10 slide box. there should be a better way ? any one can help please ?

scripterkaran avatar Mar 12 '15 09:03 scripterkaran