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

188
Visualizações
How can I overwrite or remove 'element.style'?

I am fairly new to web development and currently I am stuck on making a drop down menu transition out of sight. At the moment I have an onclick="showMenu() and onclick="hideMenu() which links to the script:

  function showMenu() {
    navLinks.style.right = "0";
    console.log("Show");
  }

  function hideMenu() {
    navLinks.style.right = "-200px important";
    console.log("Hide");
  }

The hideMenu() function does nothing because it is being overwritten im not sure how or why it is being overwritten.

element

How can I overwrite this or disable it?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The reason here may be you have defined two function for same event onclick which make that only one is applied which is first used .

You can use toggle to hide/show menu by clicking on same button , like this :

JS

function showHideMenu(){
reed1 = document.getElementById("idOfYourMenu");
cardData.classList.toggle("showHide");
}

CSS

{
.showHide{
right: 0px;/*If menu has right:-200px as initial value*/
}
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