Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

95
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda