View Full Version : Iframes in HTML windows

12-29-2009, 08:44 PM
Hello everyone. Here is the goal I wish to achieve

I want to place a blog webpage (PHP) inside an iframe object. I would like to be able to dynamically adjust the height of the entire iframe object upon each click of the mouse button (mouse event) when cursor is inside the iframe area.

Any help would be great


12-29-2009, 09:52 PM
Are both the blog and the page with the iframe on the same domain or are they different domains?

12-30-2009, 12:52 AM
If the click event bubbles up from the inner document (blog) to the iframe itself (not sure if it does; probably different from browser to browser) then it won't matter about the domains.

But you didn't mention how much bigger/smaller it should get...

var frame=document.getElementById("yourIframe");

frame.addEventListener("click", changeHeight, false);

function changeHeight() {

12-30-2009, 11:50 AM
My apologies about the very brief description.

Its a HTML page with an iframe object showing the blog page (PHP).

The Blog page and the HTML parent page are in the same directory therefore the same domain.

With regard to the iframe height on each mouse event I would like the browser to calculate the scroll height (not the display) of the blog page and adjust the iframe height accordingly so the iframe can display the blog in its full height capacity without the need for a scroll bar.


12-31-2009, 11:09 AM

01-01-2010, 07:56 AM

FYI it was New Year's Eve in the US when you bumped. Be patient. If you aren't patient don't expect much help.