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

236
Vistas
JQuery - iframe access parent javascript functions to resize iframe

I'm using winbox.js https://nextapps-de.github.io/winbox/ to create iframes and within each I'm loading local php pages which all have jQuery available.

In the main parent window I'm loading winbox.js and creating a default window as follows:

var test1 = new WinBox('Users', {
    id: 'test1',
    x: "center",
    y: "center",
    url: '/test/page1.php'
})

In page1.php jQuery is loaded and now I want to run the winbox.resize() command to resize the iframe.

From the iframe I can access the winbox.id instance property using parent.text1.id and the returns the correct id for this iframe.

The docs say you can use resize as follows:

var winbox = new WinBox("Custom Viewport");

winbox.resize("50%", "50%")
      .move("center", "center");

So I've tried in the iframe to use: parent.test1.resize("50%", "50%").move("center", "center")

But that just shows the following in the console. Uncaught TypeError: parent.test1.resize is not a function

I can resize the iframe using jQuery with: $('#test1', window.parent.document).height( '100px' );

This works, but if you manually try to resize the winbox it jumps back to it's original size before resizing. I'm guessing this is due to me manually resizing it and not using the built in options.

Can some one advise how to do this ?

Thanks

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