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

156
Visualizações
It's possible to execute css on javascript function

I need to change CSS when i click on picture. I do somes search and i find the function onclick="js function" but i don't know how to execute the css. Here is the css i need to execute on the function onclick=""

.all:hover {
perspective: 1000px;
transition: all 1.3s ease-in;
transform: perspective(10000px) rotateX(0deg);
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

this is a way for what you want:

1- Give an ID to your picture

2- you should create a class in your css file and give it these "hover" styles.

3- you should create a js function and call it with "onclick" picture event. in this example, I called my function, "myFunction".

4- create a script tag and write this function for what you want:

function myFunction() {
  var element = document.getElementById("your picture ID");
  element.classList.add("Put the class you just created in your css file");
} 
about 4 years ago · Juan Pablo Isaza Relatório
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