Resize A Page Dependant On The Content Of An Iframe?

Jan 19, 2010

Ive written some code to try and resize a page dependant on the content oof an iframe. Code is as follows:

window.onload=sizeAdj();
function sizeAdj() {
var elFrame = document.getElementById('theFrame');
var elTable = document.getElementById('tableGrab');
var elDivMain = document.getElementById('main');
var elDivWrapper = document.getElementById('wrapper');
[Code]....

I originally thought that I would just be able to resize the iframe and the other elements would follow suit but as you can see Ive tried to resize the other encasing elements also. The code resizes partially in chrome but only to a certain point and not to the full height of the doc content.

View 2 Replies


ADVERTISEMENT

Resize Parent Iframe To Fit Content With JS From Internal Page?

May 14, 2010

I have an iframe on one of my pages, and i need to resize it to fit content thing is i need to resize the iframe from the iframe src page.

I have this code:

Code:
window.onload = function()
{
resizeFrame();

[Code]....

but it doesn't seem to resize the iframe...

View 1 Replies View Related

Get The IFrame To Resize To The Content?

May 21, 2009

I've been able to get the iFrame to resize to the content - see this link - it's pretty simple. My only problem, is if the user clicks a link so that another page is displayed, the iFrame doesn't resize. It will only resize when the parent page is reloaded. So, not sure what to do about that.

(I do work with someone who writes Javascript and PHP, so they would know how to implement it if I found a solution).

View 7 Replies View Related

Resize IFrame To Content Inserted By JS?

Apr 11, 2010

I am using a WYSIWYG web editor (Serif WebPlus X4; for a whole range of reasons - please don't turn this thread into a discussion of the pros and cons of WYSIWYG! ). It has a tool to create a site search facility, whereby you add a text box to accept the search terms, and specify an iFrame in which the results appear. The source of the iFrame is not specified as a page, but rather the content is generated and inserted by the search JavaScript that runs when the user searches the page.

I really don't want the results to be in an iFrame, because I think it looks a mess when the page and the iFrame both scroll. To avoid this, I'm trying to get the iFrame to resize to fit the results, so it won't need to scroll. (Of course, the alternative would be to change the JavaScript so the results are placed directly onto a page rather than in an iFrame, but because of the way the WYSIWYG editor works, that's less straightforward).

I've found many scripts online that would let me change the size of the iFrame based on its content, but they all assume that the content is coming from a file saved on the server, and work by checking the height of the file's content, and inserting that value as the height of the iFrame. Now, the problem is that when I use these scripts they cause the iFrame to become 0px high, I assume because the frame doesn't have a fixed source that can be measured, but rather gets its content fed in from the search JavaScript.

Can anyone help me figure out a way to resize the frame even though its content is dynamically generated as the page with the frame is loaded? I've copied below the search script and the html page with the iFrame that needs to resize. Ideally, whatever solution I use shouldn't involve editing the .js file I've attached, since this is generated automatically by the WYSIWYG program.

[Code]...

View 1 Replies View Related

Resize My Iframe(ifr) Based On The Content Loaded In It?

Aug 27, 2010

I have been having an issue with this script to resize my iframe(ifr) based on the content loaded in it.I am half bald from this issue. Works perfect in IE7 & 8 but not in FF or Chrome.FF works "almost" - It resizes on first page loaded but doesn't resize if the iframe content is changed until refreshed. (example: If I load search results which shows 10 results and then click one and it loads the page which isn't as high as the search results page was then it just stays at the larger height until I refresh and then resizes correctly.)

.JS Code:

/***********************************************
* IFrame SSI script II- � Dynamic Drive DHTML code library (http://www.dynamicdrive.com)[code]....

View 2 Replies View Related

Jquery :: Resize A Window To The Content On An Iframe

Jun 30, 2010

Basically I created a nice Jquery function to resize a window to the content on an Iframe. Because the Iframe has PHP in it which pulls a list of stockists and Iframes dont Auto resize to fit its contents if it pulls extra info.

[Code]...

So this bit of code is embedded into my Iframe, all its suppose to do is get the documents (the Iframe's) current height then it selects the parent document ( the one containing the Iframe ) then it basically adds the height to the attributes.

THE PROBLEM: It works great, the first time you use it. BOOYAKASHAA. However when you click a another stockist on the list. A smaller list for example... it keeps the height of the document really big. So it initially makes the space bigger to accomadate the list. But does not go smaller afterwards?

View 1 Replies View Related

IFrame Resize To Content Height - Access Parent Document?

Sep 14, 2010

I have a webpage with an IFrame in it. The content for the IFrame could change per page and with it size. I don't want scrollbar's inside the IFrame but rather for the whole page. To accomplish this I must resize the height of the IFrame (width = fixed). But I can't seem to accomplish this. The links within the Iframe load the new content but I have to access the parent document to be able to resize the IFrame height. How I can resize the iframe from within javascript in the IFrame.

View 10 Replies View Related

How To Resize Iframe From Page In Iframe

Mar 18, 2011

I have a web page which will display another web page in an iframe. But the content inside the iframe may change while the user interacts with it so I need to be able to resize the iframe height from code on the page inside the iframe. Any tips on how I can do that? I am using php and javascript.

View 1 Replies View Related

Iframe Resize - Src - Unable To Scroll The Page

Jan 20, 2010

<iframe id="theIFrame" onLoad="resize()" style="width:100%; height:100%;" frameborder="0"></iframe>

I have this.. the src is file go.jsp in go.jsp changes occur..jsp the iframe so that there wont be scrolling dont give me solution use scorlling="no".. simply..data will be hidden below..I want to resize the page...

View 6 Replies View Related

Dynamically Resize A Navigation Div - That Is Present On Every Page - According To Size Of Main Content Div

Apr 29, 2010

I am currently trying to use Javascript to dynamically resize a navigation div (that is present on every page) according to the size of the main content div.

I am currently using the following code;

Code:

This works the first time I go to the site and if I refresh a page. However, if I use my on site navigation to switch between pages the div simply uses the height variable defined within my CSS (this needs to be here for users with JS disabled)

Does anybody have any ideas on what the problem might be. It's as if the script is only executed the first time any page on the site is loaded, but then not again.

View 6 Replies View Related

JQuery :: Resize Function That Will Resize A Window Around Content?

May 15, 2011

I'm looking for a resize function that will resize a window around content, in my case a div.

I've googled away but not come up with anything as yet so would like to ask if anyone knows a plug in that can do this simple task.

View 1 Replies View Related

Use History To Resize An Iframe When A Submit Button Is Clicked Inside The Iframe

Oct 7, 2011

Im trying to use javascript history to resize an iframe when a submit button is clicked inside the iframe.

This is what i found so far.

Code:

Us this with iframe:

Code:

Code:

But im not really sure on how to apply this to my iframe, and i know that the resize part also needs to be edited, but what is missing?

View 1 Replies View Related

Resize Iframe Depending On Height Of Iframe Contents

Aug 2, 2009

Is there a way to resize an iframe dynamically so that you never get the scroll bar and essentially hide that there is an iframe? Better integration really.Basically I want to iframe a forum into my site so that the design down the sides and top which my friend does using iweb are not messed with.We have a central area which can be longer or shorter depending on the forum.

View 3 Replies View Related

Loading A Page Dependant On Conditions

Jun 25, 2009

I am developing a course. I would like to display certain pages, depending on the Operating system.

I do not think that javascript can load a page. So I have tried the following:

In html I have:

In javascript I have:

The above was just to see if it would work.

When I click on the link I get an error that it could not find nextpage()

I have tried the simplest solution. It did not work. Is there a solution?

View 2 Replies View Related

Menu Image Dependant On Page?

Aug 5, 2009

I have a menu on a new website im developing. The menu is going to be within a PHP include file. I need a way of (using JS) the current page having its menu item with a different image to the others e.g. a "selected" image.The code im experimenting with, and which may shed a bit more light on what im trying to achieve is as follows:

var url = window.location.pathname;
var filename = url.substring(url.lastIndexOf('/')+1);
if (filename = 'about.php')

[code]....

View 2 Replies View Related

Set Stylesheet Of Iframe Page To Its Content Page?

Jan 10, 2009

I have a simple page with an iframe on; frame.html Inside this frame is a simply page; page1.html. Page1.html has a link to a stylesheet called style1.css.There is also a hyperlink to page2.html. Page2.html has a link to a stylesheet called style2.css.Now what I want to achieve is for the main page, frame.html, to style itself according to whatever is contained in page1.css, as it is page1.html on the frame. When the user uses the hyperlink and jumps to page2.html, frame.html should automatically restyle itself according to page2.css.

View 10 Replies View Related

How To Display An Iframe's Content In A Div On The Same Page

Oct 2, 2007

I have an iframe and a div on the same page. I would like to display the content of the iframe inside my div after iframe loading is completed ....

View 2 Replies View Related

Getting Content Of Iframe To Change After Page Has Loaded?

Nov 25, 2009

The project I am working on involves a flash piece that communicates with a iframe.Currently the flash piece just calls on javascript functions. I want the buttons in the flash piece to be able to change the src of the iframe.

<script type="text/javascript">
document.getElementById('video').setAttribute('src',address2);
function closeVideo() {

[code]....

View 2 Replies View Related

Link To Iframe Page (load Specific Content)

Oct 22, 2005

I have PAGE1 with the link to PAGE2 with iframe. (iframe load several
naked html). I want to add directive to the link to point sprcific
content of iframe. to make it clear

link on PAGE1 -> load PAGE2 with iframe -> iframe content is specified
on link = whole PAGE2 with iframe with desired content...

solving problem with creating several different PAGEs2 poining wanted
iframe src is not the case.

View 5 Replies View Related

Browser Back Button On A Page Using Iframe Content?

Feb 1, 2011

when you have a page that contains an iframe, and then navigate inside the iframe, hitting the browsers back button will only affect the contents of the iframe and not the entire page. I've been searching all over for solutions and cant find one that works for my current implementation.


function ShowPage(frame)
{
frames[0].location = frame+'.html'
frame.contentWindow.location.replace(newUrl);
}
[Code]...

View 4 Replies View Related

Jquery :: Get IFrame Content - Submit Form On Page?

Jan 9, 2011

I am using an iframe in my page to submit a form to so that it can upload a file - since you can't do this through the jquery ajax function. I have everything working, but I want to be able to hide the iframe and get the content of it, and put just the content inside of it into another div on the page. I have tried alot of things, but I think this one was probably closest:
$("#myframe")[0].contentDocument;
This ended up getting me a value type of "Object HTMLDocument", I just can't figure out how to get the content as a string so that I can put it into the div I want.

View 1 Replies View Related

Provide A Link To Load A Page Dependant On Current Month?

Nov 29, 2009

I want to have twelve pages giving details for each month with a navigation link "This Month" allowing the correct page to be loaded.

View 5 Replies View Related

Iframe Wont Load Content If Loading From Current Page?

Jun 8, 2011

I created a bookmarklet script to help me audit extremely large style sheets.Basically while on a site that you would like to audit, you click the bookmarklet and the document's body contents gets remove and replaced with an iframe that points to the current sites home page. From here you can choose what style sheet (the script finds) to begin reporting over. The more pages you browse (through the iframe) the more accurate the report gets.My problem however, is if the person is on the site's home page when first running the script, the iframe never loads up. I think it has to do with the fact that you are on the home page, and then the iframe tries to point to the home page as well and fails for some reason.You can test it by bookmarking this bookmarklet and running it on any site's home page where style sheets can be found:

Get The Bookmarklet on this page (http://tinyurl.com/3gx7fw5)

Again, it works great if you don't start the script from a sites home page.

View 4 Replies View Related

Iframe Resize

Aug 30, 2006

I need to adjust my IFrame Height based on srource page height (src) given for that IFrame.
I am getting it for the pages calling in the same domain like src='test.html', but I am not getting it when calling pages from other domains like src='http://someurl.com'.

My Page Looks like this:

<BODY>
<iframe src="http://someurl.com" name="NAME" scrolling="no" width="100%" frameborder="0" ></iframe>
</iframe>
</BODY>

It would be helpful if anyone suggest me a solution.

View 2 Replies View Related

Resize The Iframe Automatically

Jan 25, 2011

Is there any way to resize the iframe automatically, so that it could obtain the original height and width of the page which is embedded in that iframe? I actually saw this function on PayPal but I don't remember its link.

View 1 Replies View Related

JQuery :: Resize Iframe To Fit Contents?

May 22, 2009

i have an iframe on page to hold record editing form - the form presented in the frame needs to be different sizes depending on the form size i want the page called to resize the frame but, i can't figure out how to refer to it from the page loaded in the iframe parent().$("#myiframe").height( $("#formcontentwrapper").height() ) ;

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved