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

179
Views
Mithril.js no está actualizando el elemento html

Estoy tratando de establecer el ancho de un elemento html cuando se hace clic en un botón de menú.

 m('div.menuButton', {onclick: function () { var elNav = document.getElementById('sideNav'); if (elNav.style.width = '0') { elNav.style.width = '250'; } else { elNav.style.width = '0'; } } }, m('img.menuButton', {src: MENU_BUTTON}), )

Pero solo actualiza la página y no amplía el ancho del elemento. Si agrego m.render(); funcionará, pero luego aparece un error en la consola que dice que el elemento DOM no existe.

He intentado googlear el problema pero no encuentro nada. ¿Alguien puede ayudar?

about 4 years ago · Juan Pablo Isaza
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!