好的,讓我改變我的問題如何將所選專案作為輪播中的第一個專案?這是我的代碼。其中輸出影像是使影像顯示在輪播中的回圈。其中 carouselimage 是顯示輪播的布爾變數。
if (this.window.IndustryXCarousel && this.outputimages && this.outputimages?.length >= 0 && this.isCarouselImage) {
const outputModalCarousel = document.getElementsByClassName("output-modal-carousel");
Array.prototype.map.call(outputModalCarousel, (outputCaro: any) => {
const parent = outputCaro.closest(".-modal");
let parentStyle = window.getComputedStyle(parent, null).display;
if (parentStyle == "block") {
let IndustryXCarousel = window.IndustryXCarousel;
let outputObj = null;
console.log(outputObj)
outputObj = new IndustryXCarousel(outputCaro, {
items: 3,
firstItemFixed: false,
arrows: true,
dots: false,
leftArrow: `<i ></i>`,
rightArrow: `<i ></i>`,
margin: 40,
responsive: [
{
maxWidth: 1500,
items: 1,
},
{
maxWidth: 1250,
items: 1,
},
{
maxWidth: 600,
items: 1,
},
],
});
}
});
this.isCarouselImage = false;
}
uj5u.com熱心網友回復:
你可以let i = index在指令引數中做,因此你會知道索引
<div *ngFor="let item of items; let i = index">
<button (click)="slideTo((i 1)%items.length)">next</button>
....
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/322402.html
標籤:javascript 有角的
上一篇:根據角度的資料庫值檢查復選框
