Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

104
Visualizações
Set JavaScript variable to match another variable on click with memory

I'm looking to allow users to change the images on a site, and save the new images in local storage.

There are 5 divs with background images (can all be declared in variables). When each is clicked, it brings up a container that includes 10 image options (more variables). When the user clicks an option, the container closes and some jQuery sets the background image of the div that was clicked to the image that was clicked.

Having some trouble wrapping my head around the variables - the container is global, so the script needs to remember which div was clicked and only change the background image of that div. And to save it in local storage, the variable for the background image needs to be saved as the image URL selected. Is there some dynamic variable or array work to be done here? Appreciate the help!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda