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

144
Views
Image slider with fade effect only javascript no JQuery

JS now its working automate, but i want to create to buttons left and right and slide it on click

This is HTML

<div id="bcg">
            <img id="slider" src="img/backgrounds/bg.jpg" alt="">
            <img id="slider" src="img/backgrounds/bg-1.jpg" alt="">
            <img id="slider" src="img/backgrounds/bg-2.jpg" alt="">
            <img id="slider" src="img/backgrounds/bg.jpg">
</div>>

This is CSS

#bcg {
width: 100%;
height: 100%;
display: flex;
position: absolute;
overflow: hidden;
top: 0;
left: 0;
 }

#bcg img {
width: 100%;
height: 100%;
}

/// This is JavaScript, i want to work on click//

 var imgArray = [
     "https://www.ncesc.com/wp-content/uploads/2021/07/business-development-manager-job- 
description.png",
    "https://www.compuvis.com/images/site/slider/download.jpg",
    'https://koinworks.com/wp-content/uploads/2021/04/bisnis-proposal.jpg'],
    curIndex = 0;
imgDuration = 3000;

function slideShow() {
    document.getElementById('slider').className += "fadeOut";
    setTimeout(function () {
        document.getElementById('slider').src = imgArray[curIndex];
        document.getElementById('slider').className = "";
    }, 1000);
    curIndex++;
    if (curIndex == imgArray.length) { curIndex = 0; }
    setTimeout(slideShow, imgDuration);
}

slideShow()
about 4 years ago · Juan Pablo Isaza
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!