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

134
Views
El modo oscuro/claro se mantiene entre cambiar a través de la navegación

así que tengo un problema con este código que no mantiene el color cuando la persona elige cambiar al modo de luz y luego se mueve a una página diferente que se reinicia. ¿Cómo lo cambiaría para que se mantuviera del color que eligieron entre páginas?

Aquí está el HTML

 <div class="switch-wrap"> <div id="switch" class="hover-target"> <div id="circle"></div> </div> <!--Credits to Ivan Grozdic Navigation/Dark/Light--> <p><span>dark</span> - <span>light</span></p> </div>

Aquí está el javascript/jquery

 $("#switch").on('click', function () { if ($("body").hasClass("light")) { $("body").removeClass("light"); $("#switch").removeClass("switched"); } else { $("body").addClass("light"); $("#switch").addClass("switched"); } }); })(jQuery);

He intentado hacer un document.cookies (ifDarkmode.istrue) y mantenerlo, pero no he conseguido que funcione porque soy nuevo en la codificación.

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!