Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

182
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda