Solved

Javascript to auto resize an iFrame

Posted on 2007-11-19
4
1,945 Views
Last Modified: 2009-12-16
Hi

Does anyone have any javascript for resizing an iframe, a client does not want to have scrolling bars but needs to pull content from another website which is providing a search service for them.

Ideally it needs to get the content height and set the size of the iframe.

Alternativly can anyone reccomend another method for pulling content from another url and displaying it in my page. Never really used frames so would not know the best way to use them, the page is built with html/css and cant lose any formating.

Here is my current attempt!!

http://clients.fruit-studios.com/curtisfrank/search.html


Many thanks in advance

-s-
0
Comment
Question by:socross
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
Mr_Splash earned 500 total points
Comment Utility
The following works well

"resizing the IFRAME to be the height of the page contained within it, eliminating any possible IFRAME scrollbars from appearing while snugly showing the entire external content."

http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm
0
 
LVL 1

Author Comment

by:socross
Comment Utility
perfect thanks

will try and implement shortly

-s-
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
Interesting... If the other one does not work and this does...
0
 
LVL 1

Author Comment

by:socross
Comment Utility
The script does exactly what is required but only for documents from the same domain.

See this question for the required steps to use the script with content from another domain, it uses curl to get the required html and displays it in the iframe.

http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_22965420.html

Thanks to all

-s-
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now