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

185
Views
Ajuste automáticamente la altura de los iframes de acuerdo con el contenido de las pestañas de Avada (tema WP)

Intento ajustar automáticamente la altura de los iframes de acuerdo con el contenido dentro de las pestañas de Avada (Tema WP).

Encontré aquí , en stackoverflow, este código:

Antes de cerrar la etiqueta </body> :

 <script type="text/javascript"> function getDocHeight(doc) { doc = doc || document; // stackoverflow.com/questions/1145850/ var body = doc.body, html = doc.documentElement; var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight ); return height; } function setIframeHeight(id) { var ifrm = document.getElementById(id); var doc = ifrm.contentDocument? ifrm.contentDocument: ifrm.contentWindow.document; ifrm.style.visibility = 'hidden'; ifrm.style.height = "10px"; // reset to minimal height ... // IE opt. for bing/msn needs a bit added or scrollbar appears ifrm.style.height = getDocHeight( doc ) + 150 + "px"; ifrm.style.visibility = 'visible'; } document.getElementById('ifrm').onload = function() { // Adjust the Id accordingly setIframeHeight(this.id); }

En cada pestaña:

 <iframe id="ifrm" src="https://TheTabUrl.com"></iframe>

Me funciona pero solo en la primera pestaña. Tengo 4 iframes en 4 pestañas diferentes en la misma página. Por favor, ¿alguna idea sobre la forma de hacerlo funcionar?

Gracias por su tiempo por adelantado. Saludos

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!