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

93
Views
How to make a slider on background image on click?

I am looking for help to make a background slider on click. But so far not found any help. This is the html section where class with section-1 is given the background:

<div className="section-1">
        <div className="first-button">
                <button>Enroll Now</button>
                </div>
        <i class="fa fa-angle-right scroll-button" onclick="plusSlide(-1)" aria-hidden="true"></i>
        <i class="fa fa-angle-right scroll-button-left" onclick="plusSlide(1)" aria-hidden="true"></i>


        </div>

And this is the CSS:

.section-1 {
    background-image: url(./assets/bg1.jpg);
    height: 75vh;
    width: 100%;
    background-repeat: no-repeat;
    background-position: center center; 
    background-size: cover;
    position: relative;
}

I also try to give it some javascript. But that javascript is only applicable in the case of simple image. I have done simple images through loop and some css classes.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Even though this is a reactjs topic I'll give it a try using the hover action and only css.

  1. Try adding to your html a tag under your image (I used just a "p" tag) and give it a class of "slider".
  2. Now on your .css file add:

.slider {
  padding: 25vh 0;
  width: 100%;
  background-color: red;
  position: relative;
  top: 6.25vh;
  text-align: center;
  transition: 0.2s;
  opacity: 0;
}

.slider:hover {
  opacity: 1;
}

What this does basicaly is we style our paragraph to be a slider with it's text in the middle, and the moment we hover over it with our mouse the slider will appear with the text. You can edit the transition and the effect all you want. The basic idea is this.

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!