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

112
Views
Cambiar color svg con intervalo establecido

Actualmente estoy trabajando en un proyecto y quiero cambiar el color SVG con intervalo de tiempo...

 var bulbColors = [ '#FFFFFF', '#27ae60', '#16a085', '#f39c12', '#e74c3c', '#9b59b6', '#FB6964', '#342224', '#472E32', '#BDBB99', '#77B1A9', '#2c3e50' ]; $(function (){ var i = 0 $('svg').find('path', this).attr('fill', 'bulbColors[i]') setInterval(function(){ i++; if (i == bulbColors.length){ i = 0; } $(this).fadeOut('slow', function () { $('svg').find('path', this).attr('fill', 'bulbColors[i]') $(this).fadeIn("slow"); }) }, 6000); })
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Intenta cambiar este código

 $('svg').find('path', this).attr('fill', 'bulbColors[i]')

Debe quitar las comillas bulbColors[i], de lo contrario, javascript lee el argumento como una cadena, y no el color hexadecimal en la lista en el índice [i].

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!