Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

147
Views
Is there a way to get the selected item as first item in carousel?

Ok let me change my question how to get the selected item as first item in carousel? This is my code. where output images is the loop to get the images to display in carousel. where carouselimage is the boolean variable to display carousel.

 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 class="icon-chevron-left"></i>`,
        rightArrow: `<i class="icon-chevron-right"></i>`,
        margin: 40,
        responsive: [
          {
            maxWidth: 1500,
            items: 1,
          },
          {
            maxWidth: 1250,
            items: 1,
          },
          {
            maxWidth: 600,
            items: 1,
          },
        ],
      });
    }

  });
  this.isCarouselImage = false;
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you can do let i = index in the directive params and thus you will know the index

<div *ngFor="let item of items; let i = index">
   <button (click)="slideTo((i + 1)%items.length)">next</button>
   ....
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!