javascript - How can I resize an iFrame from within the child page? -


is there way of resizing iframe when content within changes dimensions, example after javascript effect?

in example link have used show/hide javascript effect, resulting overflow getting hidden because iframe can't communicate.

my website example (click page 2 , you'll see longer text hidden)

thanks

yes possible. it's done facebook app example.

to access iframe main document:

window.frames['iframename'].document.callafunction() window.frames['iframename'].document.getelementbyid('foo') 

from iframe parent document:

parent.document.callafunction() parent.document.getelementbyid('foo') 

keep in mind works, if both documents loaded same domain.

now can do:

  • fetch event if iframe content changes
  • submit new size parent document
  • the parent document changes iframes dimension

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -