0

I am wondering if anyone can help me which this problem, I have an iframe to a URL(on a subdomain). The page in the iframe has a button to another page. I would like to be able to resize iframe when the user moves to the other page in the iframe. Below is how I am sizing the first page.

 $disp = '<div style="border: 0px solid rgb(201, 0, 1); overflow: hidden; margin: 50px auto; max-width: 300px;">

<iframe scrolling="no" src="https://something.com" style="border: 0px none; margin-right: 188px;height: 1036px; margin-top: -380px; width: 297px;">
</iframe> 
</div>';

echo $disp;
Jimbo Jones
  • 983
  • 4
  • 13
  • 48

1 Answers1

1

Using onLoad you can tell if the iframe source changes, as explained here:

iFrame src change event detection?

The gist is

<iframe src="http://www.google.com/" onLoad="yourJsFunc();"></iframe>

or, with jQuery

$('#iframeid').load(function()
{
    alert('frame has (re)loaded');
});
Community
  • 1
  • 1
Luke
  • 3,985
  • 1
  • 20
  • 35
  • I have tried using onload, however the problem is that I cant find if the url has changed within the iframe. As the page in the iframe is not on the domain of the page that displaying the iframe. – Jimbo Jones Sep 10 '14 at 15:59