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

234
Views
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
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!