Note that there are some explanatory texts on larger screens.

plurals
  1. POIFrame properties and events
    primarykey
    data
    text
    <p>Consider this situation (and please don't question its reasonability):</p> <p>I want to have Google in an IFrame that takes exactly half of the width of the page and full height. Fairly simply to achieve. But I want to have only one, global (for the window), scrollbar. This is where it gets problematic...</p> <ol> <li><p><strong>I want the page window, to expand to the IFrame's height.</strong><br> How do I do that? I'm even struggling at this moment to get the IFrame's contents height. Of course querying IFrame for height is not the way to do it, I need to query it's contents. Tried <code>$("iframe#google").contents().find('html').height()</code>, but constantly getting <code>null</code>. Just <code>$("iframe#google#).contents()</code> aready returns an empty object.<br> Assuming I've figured it out somehow (with your help hopefully), how do I detect IFrame's content's height change? Is there an event I can bind a function to, or <code>setTimeout</code> is ugly, but only solution to make it responsive.</p></li> <li><p><strong>I want to know when IFrame's url changes (including hash url).</strong><br> How do I even find out current IFrame's url? <code>src</code> property doesn't seem to change when navigating to other locations.<br> Again, assuming I've figured that one out, is there an event to help me detecting this? <code>load</code> does seem to do the job if the main url (without hash part) changes. But what about if I want to detect hash url change too?</p></li> </ol> <p>Will really appreciate your help with these.</p> <hr> <p><strong>EDIT</strong></p> <p>It is probably worth noting that neither can be done with Google as they're Cross-Domain policy doesn't allow this. If the IFrame is from the same domain, the script in the first post does work.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload