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

194
Views
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 answers
Answer question

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 Report
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!