Jump to content

help: dynamically set size of object containing an html page


sweetname

Recommended Posts

I originally posted a question in the html section, but this is really more of a javascript question I think.  Sorry about that.

 

I have loaded a html page into an object (similar to an iframe) and I cannot figure out how to dynamically set the height.  I have tried to approach it like an iframe, but this doesn't work. http://www.mattcutts.com/blog/iframe-height-scrollbar-example/

 

Can anyone help me figure out the height to set my object so that it doesn't have scroll bars?

 

Thanks

Link to comment
Share on other sites

i don't think your going to be able to reference the object tag based on contentWindow; because contentWindow was meant to be used with FRAME, IFRAME, HTMLFrameElement Constructor, HTMLIFrameElement Constructor.

 

you can find the oject tag's usable attributes here: http://www.w3schools.com/TAGS/tag_object.asp

 

alternatively, you could hide an iframe with the same src and use the contentWindow method for that hidden iframe; too change the height of the object tag.

Link to comment
Share on other sites

I know you can't do it that way.  That is how it is done for iframes.  I was trying to show the effect I am trying to mimic with the object.  I want to use the object tag instead of iframe.  Is it possible to achieve something similar with an object?  I want to use an object tag so that I can validate.

 

Thanks

Link to comment
Share on other sites

The iframe tag wont validate in xhtml 1.0 strict and everything I read on blogs and such state that the object tag has replaced the iframe, however nobody shows how to fit the object height to the content in it.  If I were to use a hidden iframe, what would be the point of using the object in the first place?  I am a little confused by the suggestion?  Please explain?

 

Thanks

Link to comment
Share on other sites

objects have not replaced iframe; each are probably used equally, but not for what your wanting to do. i really have never seen anyone include a html page in a object. one of the main reasons for that is; you can have more control over an iframe. it's up to you what you want to use to display your content, but it is  not going to be as easy to manipulate an object, as it would be for any type of frame.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.