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

180
Views
JS cambiando la altura de CSS usando variable

Creé una secuencia de comandos que toma la altura de dos elementos y, si uno es más pequeño que el otro, ajustará la altura en consecuencia para que coincida. Salir del registro de la consola que está haciendo y reconocer todo como se esperaba, excepto cambiar la altura de los elementos, lo que supongo que se debe a que está almacenado como una variable. Cualquier ayuda apreciada.

 console.log('Start of script.'); let divElement = document.getElementById("basic-calendar-card"); let style = window.getComputedStyle(divElement); let height = style.getPropertyValue("height"); console.log('Basic calendar height = ' + height); let divElementTwo = document.getElementById("list-calendar-card"); let styleTwo = window.getComputedStyle(divElementTwo); let heightTwo = styleTwo.getPropertyValue("height"); console.log('List calendar height = ' + heightTwo); if (height < heightTwo) { console.log('List calendar is bigger.') divElement.style.height = heightTwo; } else if (heightTwo < height) { console.log('Basic calendar is smaller.') divElementTwo.style.height = height; } else { console.log('Same size.') } console.log('End of script.');
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!