Resize External Website in Iframe using Javascript.

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Mar 2008
Posts: 36
Reputation: lonestar23 is an unknown quantity at this point 
Solved Threads: 0
lonestar23 lonestar23 is offline Offline
Light Poster

Resize External Website in Iframe using Javascript.

 
0
  #1
Nov 19th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 167
Reputation: Drew is an unknown quantity at this point 
Solved Threads: 7
Drew's Avatar
Drew Drew is offline Offline
Junior Poster

Re: Resize External Website in Iframe using Javascript.

 
0
  #2
Nov 19th, 2008
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.
Drew Gauderman
ASP / MSSQL Coder
http://www.iportalx.net - My ASP Portal
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 36
Reputation: lonestar23 is an unknown quantity at this point 
Solved Threads: 0
lonestar23 lonestar23 is offline Offline
Light Poster

Re: Resize External Website in Iframe using Javascript.

 
0
  #3
Nov 19th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 167
Reputation: Drew is an unknown quantity at this point 
Solved Threads: 7
Drew's Avatar
Drew Drew is offline Offline
Junior Poster

Re: Resize External Website in Iframe using Javascript.

 
0
  #4
Nov 19th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 36
Reputation: lonestar23 is an unknown quantity at this point 
Solved Threads: 0
lonestar23 lonestar23 is offline Offline
Light Poster

Re: Resize External Website in Iframe using Javascript.

 
0
  #5
Nov 19th, 2008
Ok, I will test it out later today. Thanks!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC