943,753 Members | Top Members by Rank

Ad:
Nov 19th, 2008
0

Resize External Website in Iframe using Javascript.

Expand Post »
Hello,

I am trying to resize an external website in an iframe using javascript, but have not found code that works very well. Anyone know how to go about it? Thanks in Advance!
Last edited by lonestar23; Nov 19th, 2008 at 2:27 pm. Reason: Added a thanks in advance
Similar Threads
Reputation Points: 20
Solved Threads: 0
Light Poster
lonestar23 is offline Offline
43 posts
since Mar 2008
Nov 19th, 2008
0

Re: Resize External Website in Iframe using Javascript.

If the website loading in the URL has a fixed size then you would have to code something to dig through the iframe and remove the sites fixed width.

But if the sites content is bigger than the frame, there really isnt much you can do besides setting "overflow: hidden" to most of the elements in the iframe.
Reputation Points: 25
Solved Threads: 7
Junior Poster
Drew is offline Offline
166 posts
since Apr 2004
Nov 19th, 2008
0

Re: Resize External Website in Iframe using Javascript.

The external sites will have a fixed width, but not a fixed height. The height would range from 700 pixels-850pixels. Just looking for something that measures a height of an external site, with no use of sever code.
Reputation Points: 20
Solved Threads: 0
Light Poster
lonestar23 is offline Offline
43 posts
since Mar 2008
Nov 19th, 2008
0

Re: Resize External Website in Iframe using Javascript.

You would have to use javascript and a onload event on the iframe.

(untested)

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. iframeName.onload=function() {
  2. iframeName.style.height = iframe.document.body.innerHeight;
  3. };

Something like that might work.
Reputation Points: 25
Solved Threads: 7
Junior Poster
Drew is offline Offline
166 posts
since Apr 2004
Nov 19th, 2008
0

Re: Resize External Website in Iframe using Javascript.

Ok, I will test it out later today. Thanks!
Reputation Points: 20
Solved Threads: 0
Light Poster
lonestar23 is offline Offline
43 posts
since Mar 2008
Jun 9th, 2010
0

lonestar23, did you ever find a solution to this?

lonestar23, did you ever find a solution to this?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
agfucious is offline Offline
1 posts
since Jun 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Statistics script for website
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Validate arrays of textarea in PHP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC