我在離子2上工作。
我在一個數組列表中有很多滑塊,這是自動滑動。 我需要從該列表中選擇隨機幻燈片,我該怎麼辦?如何選擇離子2中的自動隨機滑塊?
*****************************************************
Your system information:
Cordova CLI: 6.4.0
Ionic CLI Version: 2.1.8
Ionic App Lib Version: 2.1.4
ios-deploy version: Not installed
ios-sim version: 5.0.8
OS: OS X Yosemite
Node Version: v6.2.2
Xcode version: Xcode 7.2 Build version 7C68
******************************************************
代碼,我原樣 mypage.html--
<ion-slides #mySlider [options]="mySlideOptions">
<ion-slide *ngFor="let quote of slides">
<div class="myslider">
<div class="quote-container" [innerHTML]="quote.title"></div>
<div [innerHTML]="quote.author" ></div>
</div>
</ion-slide>
</ion-slides>
page.ts--
slides: Slide[];
this.slides = [
{id: 1, author: "-Sanjay", title: "my text goes here."},
{id: 2, author: "-Sanjay", title: "my text goes here"},
{id: 3, author: "-Sanjay", title: "my text goes here"},
{id: 4, author: "-Sanjay", title: "my text goes here"}]
的slider-
// quotes slider
mySlideOptions = {
initialSlide: 0,
loop: true,
effect: 'fade',
fade: {crossFade:true},
autoplay:2700,
autoplayDisableOnInteraction: true,
direction:"horizontal",
speed:4000,
nextButton: ".pause-me",
prevButton: ".swiper-button-prev"
};
但不是Fonction隨機滑動,任何幫助?
你的問題檢索是不明確的,你要顯示的圖像的隨機順序? – Sakuto
是的,類似的東西,但所有的圖像必須在數組列表中。 –