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

76
Views
¿Es posible cambiar el fondo del cuerpo de una página con un carrusel de jquery slick?

Si tengo varios divs en un carrusel y quiero que uno de los divs cambie el fondo de la página, ¿sería eso posible?

mientras el carrusel está EN el div, no flotando o haciendo clic en

 if ($('.carousel').slick('slickGoTo', 1)){ //if slick is on slide index 1 //change to another page where I've already changed the page's background location.href = page location; //or change the body's background let body=document.getElementsByTagName("body"); body.style.background = "image url"; });

Editar: https://jsfiddle.net/milytulip/L27nhvbr/

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

0

Según los documentos , esto debería funcionar:

 $('. carousel').on('afterChange', function(slick, currentSlide){ if (currentSlide===1) { $('body').addClass('specialBG'); } else { $('body').removeClass('specialBG'); } });

y luego tenga el estilo listo para la diapositiva especial

 body.specialBG { background-color:#333; }
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!