View Full Version : Dynamically Expanding Embedded Objects
12-28-2009, 07:08 PM
Is there a way to get <object>'s to expand depending on content?
I tried to style="overflow: visible;" and this didn't work either. Is there a solution?
12-28-2009, 07:37 PM
Expanding to fit it's content is <object>'s normal behavior.
Can you show us how you're using it?
12-28-2009, 08:37 PM
I'm using it with like this:
However, it only shows in a box that looks like it's 400px by 300px
12-28-2009, 09:01 PM
What size is resultedinfo.php? What styles resultedinfo.php? What styles <object>? What contains <object>?
And, since there is some question as to browser support (http://www.w3schools.com/TAGS/tag_object.asp)for <object>, what browser are you seeing the problem in?
Not to sound rude or anything but this information is needed to figure out a solution to your problem. A little help from you (see #3) (http://www.codingforums.com/postguide.htm) would go a long ways toward finding an answer.
12-29-2009, 10:51 AM
I'm using it with like this:
However, it only shows in a box that looks like it's 400px by 300pxAs far as I'm aware, the object element, like the iframe element, does not resize to fit the content of document types such as HTML and XHTML (which is what I presume the PHP output is). It will resize to fit content with an intrinsic width (i.e., images), but that's about it; otherwise, you get a default width unless you specify one. If I'm not mistaken, the default is 300×150 pixels per the CSS spec.
12-29-2009, 09:30 PM
So questionable, if the php output is html ... what is the reason for putting it in <object> tags?
12-29-2009, 10:24 PM
Yes Arbitrator, the output is html. I originally used an iframe but I've been told that the object tag is more versatile. Is there anyway to get either of these to auto resize so the content isn't the default size?
12-30-2009, 04:35 AM
So questionable, if the php output is html ... what is the reason for putting it in <object> tags?If I'm not mistaken, the iframe element is disallowed in HTML 4.01 Strict because the intention was that the object element would replace it.
Yes Arbitrator, the output is html. I originally used an iframe but I've been told that the object tag is more versatile.Given the implementation problems, I'm not so sure about that. It's more versatile than, say, the img element since you can use markup as fallback, but for HTML pages, I'm not so sure.
Is there anyway to get either of these to auto resize so the content isn't the default size?Yes, using the CSS/HTML width and height properties/attributes you can do this.
I assume you misspoke though and meant to ask if there was a way to get the frame to size to the document. As far as I'm aware, there is no way to do this with HTML 4.01. The closest you could get it to parse the document with a server-side language and add the output to your document (on the server side).
HTML 5 will allow this with the seamless attribute on iframe elements, I believe, but I'm not aware if any browser vendor that has implemented it yet. object apparently lacks a new, similar attribute.
12-30-2009, 06:16 AM
12-30-2009, 05:05 PM
That solved my problems. <div>'s don't have a src attribute but I was able to use:
url = document.location.href+"?findme="+escape(findthis);
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.