Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

235
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda