Forum Moderators: open

Message Too Old, No Replies

Resizing iframe to size of src

         

putts

8:10 pm on Jan 12, 2004 (gmt 0)

10+ Year Member



There was an older post out here on this and it is now closed, but I have a function that I think will work for it....


function checkSize()
{
var newHeight = alertWindow.document.body.scrollHeight;
if(document.all)
if(document.all.item("alertWindow").scrollHeight > 0)
document.all.item("alertWindow").style.height = newHeight;
else
document.frames(alertWindow).height = newHeight;
}

Works in IE, but haven't tested it in other browsers and am not too sure the proper attributes to set, so that may need some tweaking.

tedster

7:58 am on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, putts. Thanks for posting your script. That should help a few iframe fanatics -- I've never touched the stuff myself, so far, but you never know.

putts

12:57 pm on Jan 14, 2004 (gmt 0)

10+ Year Member



well if you consider that with a resizable iframe you can load any page into the middle of your page.

You, then, have a technique for avoiding using javascript: confirms and vbscript: msgBoxes by just loading page validation, delete Continue/Cancels and the like into an iframe.

This, of course, helps get away from doing too many things client-side, which, I've found, you want to avoid if at all possible as Client-side always seem to scream "Please Hack Me" to many people who know what they're doing.