Problem With Iframe Resizing

Jul 23, 2005

Can someone help me here because this is really killing me!

the problem is, i have this javascript code in my aspx page that i want
it to work on almost all browsers, especially opera and safari :

function resize(){
displayFrm = document.getElementById("ifrmDisplay");

innerDoc = (displayFrame.contentDocument) ?displayFrm.contentDocument :
displayFrm.contentWindow.document;

objToResize = (displayFrm.style) ? displayFrm.style : displayFrm;

objToResize.height = innerDoc.body.scrollHeight;
}

the code above gets called every time a new page is loaded inside the
iframe (ifrmDisplay) what its doing is resizing the iframe so it can
have the same size as the page inside it, so i can eliminate the need
for vertical scroller for the iframe, i assumed that it works on opera
and IE at the same time, when i tried it out, it worked on IE but not on
opera. after lot of time in researching how i can get workaround this
issue with opera, that is the best possible solution i have and yet it
doesnt work. so i gave up and asking you if you can help me out here ,
coz this is jst driving me crazy!

the problem is im not a javascript expert, to be honest i jst started
doing javascripts about two days ago, that is why im in need for help

by the way, here is inner html for the iframe if its any use

<iframe id="ifrmDisplay" style="Z-INDEX: 99; LEFT: 187px; WIDTH: 567px;
POSITION: absolute; TOP: 136px; HEIGHT: 408px" src="" scrolling="no"
onload="resize();">
</iframe>

View 4 Replies


ADVERTISEMENT

Iframe Resizing Each Time New Page Loads In Iframe

Aug 14, 2009

I'd like to resize an iframe into which different (same domain) pages of differing heights are loaded. I can do a first-time resize no problem. It's the subsequent reloads that need to pass back their height to the parent page There seem to be lots of solutions for that around, but few I can see for resizing each time the iframe reloads. One is described here on another board [URL] but unfortunately the test page is no longer around (or indeed the site), so the full code is no longer available there. This one works, almost, for me: [URL] it does resize for me, but not quite sufficiently high each time - about 90% of what is required: [URL] Is there a way to add on sufficient extra margin that scrollbars no longer appear?

View 8 Replies View Related

Resizing Table/iframe

Jul 23, 2005

I have an iframe embedded in a single cell table. I'd like to resize the
table and iframe to match any changes made to window size. Is this possible?

View 3 Replies View Related

Iframe Resizing On Opera

Jul 23, 2005

the problem is, i have this javascript code in my aspx page that i want
it to work on almost all browsers, especially opera and safari :

function resize(){
displayFrm = document.getElementById("ifrmDisplay");

innerDoc = (displayFrame.contentDocument) ?displayFrm.contentDocument :
displayFrm.contentWindow.document;

objToResize = (displayFrm.style) ? displayFrm.style : displayFrm;

objToResize.height = innerDoc.body.scrollHeight;
}

the code above gets called every time a new page is loaded inside the
iframe (ifrmDisplay) what its doing is resizing the iframe so it can
have the same size as the page inside it, so i can eliminate the need
for vertical scroller for the iframe, i assumed that it works on opera
and IE at the same time, when i tried it out, it worked on IE but not on
opera. after lot of time in researching how i can get workaround this
issue with opera, that is the best possible solution i have and yet it
doesnt work. so i gave up and asking you if you can help me out here ,
coz this is jst driving me crazy!

the problem is im not a javascript expert, to be honest i jst started
doing javascripts about two days ago, that is why im in need for help

by the way, here is inner html for the iframe if its any use

<iframe id="ifrmDisplay" style="Z-INDEX: 99; LEFT: 187px; WIDTH: 567px;
POSITION: absolute; TOP: 136px; HEIGHT: 408px" src="" scrolling="no"

</iframe>

View 5 Replies View Related

Resizing Iframe To Fit Content?

Nov 30, 2011

resizing an iframe to fit it's content.

Basically, I have 10 spreadsheet pages saved as htm files.

I am creating a page that enables me to view each of these htm files.

I need the iframe to be resized for each htm file.

This is my code:

<html>
<head>
<script language="javascript">
<!--

[Code]....

This seems to work but it has a few issues, It does not resize properly for every link, only some of them.

View 2 Replies View Related

Cross Domain Iframe Resizing?

May 8, 2011

i am trying to resize an iframe which is not in same domain.I tried couple of ways as below: iam loading an html which is in other domain.I kept this syntax in script

function toBeCalledOnChildHTMLLoad()
{
parent.document.getElementById("ifameId").height = calculatedHeight;
}

Still it is not working..Please suggest if u have any solutions on this.

View 5 Replies View Related

Dynamic Iframe Resizing On Multiple Layers?

Sep 15, 2011

Its my first in this community and I hope someone can help me on this one. I�m currently working on the personalization of the layout of SAP ERP Portal. This Portal Framework uses Iframes to display the current page and/or applications on the Current Page.Here is a custom draw of a page

---- Custom Componentes Like Menus etc

----- Iframe (InnerPage) � Shows the Current Page

--------This Page can have embedded content and/or More Iframes with Applications

All the Iframes are on the same domain but I only have acess to the innerPage Code and not to the iframes that have the applications.Now we want the innerpage to automatic resize to the current content. This is being a problem (even after using jQuery Plugins or Resize Scripts) because:

1)The Iframes that have the applications change content height using Ajax/DHTML (not triggering load event) and this resize scripts wont call the resize mechanism.

2)I don�t have access to the applications source

3)On some tests ive made using Scripts ( for example Auto Height Jquery, SSI Dynamic Drive )some iframes display the same clientHeight and ScrollHeight Even if theres a scrollbar in the browser window.

View 1 Replies View Related

Auto-resize An Iframe - Height Is Not Automatically Resizing?

Aug 4, 2010

I have a mysql database with a bunch of quotations in it. I created a blog at http:[url]....At the top of the blog is an iframe window that directs to http:[url]....On that page it uses php to pull out a random quote from the database. The iframe window displays that quote onto the blog.It works great except that the height is not automatically resizing.Is there a way I can use javascript to do this instead? Here is some pseudo-code of what I'd like to be able to do: (p.s. I do not know javascript or much of anything so I am looking for people to tell me how to ACTUALLY do this)

var stringvariable = http://aro2220.com/blog/index.html;

int stringlength = stringlength(stringvariable);

int autosize = 200 + stringlength * 5;

<iframe width="100%" frameborder="0" src="http://aro2220.com/blog" height=$autosize scrolling="no"></iframe>

View 7 Replies View Related

Ajax :: IFrame Content (JSP File) Height Resizing

Apr 22, 2010

Having a problem with iframe resizing when the iframe body is a jsp file which contains a dynamically built ajax table. Users select different options from a drop down. All but 1 is a standard static jsp file. The other is a jsp file with a dynamic ajax table which is generated the second the user select this option from the drop down. Problem is the javascript is not getting the correct height for the dynamically ajaxed jsp file.

Here is the iframe which is loading the contents file.
<iframe id="Editor" name="Editor" src="" scrolling="no" frameborder="0" allowtransparency="true" onLoad="resizeIframeToFitContent(this)"></iframe>
Resize call:
function resizeIframeToFitContent(iframe) {
iframe.height = Editor.document.body.scrollHeight + 300;
iframe.width = Editor.document.body.scrollWidth;
} // resizeIframeToFitContent

As a current workaround I am adding 300 manually to the height this works but throws the height of the normal jsp files well out and makes the page to tall.

View 1 Replies View Related

Cross Browser, Cross Domain Iframe Resizing Script?

Jun 18, 2009

Is there any way to resize an iframe dynamically to the height of its content that works cross browser and works when the iframe content is on another domain than the main page (I have access to both pages, so code can be put in either) Also, it must resize when links in the iframe are clicked (ie when a new page within the iframe is loaded)

View 1 Replies View Related

IFRAME Resizing Automatically Is Called "star_content"

Mar 12, 2011

I found a javascript code online which automatically resizes an IFRAME based on the content loaded into it.

[Code]...

As you can see, the IFRAME I am resizing automatically is called "star_content" - This frame exists on a page with a set of links below it, which determine what content is to be loaded into it. The content being loaded into it is Daily, Monthly and Yearly horoscopes. The longest being the Yearly one. Now when I click the yearly one, the iframe extends as expected... but if I go from the yearly one back to the Daily or Monthly one, it doesn't shrink again so I end up with a huge gap. I can't show you the page itself because it's a closed site, still in development and I am under a non disclosure contract. However, here is the IFRAME HTML.

[Code]....

So to sumarise, what I want to do is have the iframe automatically resize to fit the content that has been loaded within it. It's doing that when it needs to extend the height of the frame but it's not then reducing the height when it goes back to something smaller.

View 2 Replies View Related

Resizing A DIV

Dec 12, 2006

I've read through a number of links that discuss various methods of
resizing a div; however, nothing seems to work correctly for me. The
basic idea is that I would like to implement is a panel that can be
hidden (to save space), but collapses smoothly, rather than all at
once.

I've tried setting the div's style.height property. Doing so does, in
fact, resize the div (at least in Firefox 2.0); however, the inner text
does not disappear as the div is resized. Should I apply another CSS
style to the inner text or is there another method of obtaining the
desired results? Code:

View 4 Replies View Related

Resizing A Div?

Sep 20, 2009

<div id="resizetest" style="width:200px;height:200px;border:2px solid blue">
<div style="background:#000033">
<a href="#" style="float:right;background:#ffffff" onclick='document.getElementById("resizetest").height="50";'>_</a>[code]....

Why doesn't this resize? I've looked at examples, and I don't see what's wrong.

View 5 Replies View Related

Resizing The Window

Jul 23, 2005

I want to reload th page after resizing the window (Browser). I used the
event onresize.

The problem the server gets too many requests (on every resize: pixel by
pixel).

window.onresize = myfunction();
What can I do to reload the page only after releasing the mouse.

View 2 Replies View Related

Popups And Resizing

Jul 23, 2005

I am using a popup window to show pictures. Each time the user clicks on
a thumbnail in the mail HTML page, the popup either appears or reloads a
new picture.

Some pictures are portrait, and some are landscape. I build the popup
html dynamically. How can I a) resize the popup window to fit the image,
and b) pop it to the forefront once the new picture is loaded?

View 8 Replies View Related

How To Prevent Div From Resizing

Dec 10, 2005

i have a div, i set the innerHTML property to a formatted paragraph of
text. however, at times the text exceeds the width (and height) of the
div. how do i create a fixed width div and make it use a scrollbar if
the contents exceed the height and width specified. i'm using microsoft
visual studio, and i have the width explicitly set in the properties
but still on setting the innerHTML it resizes automatically.

View 5 Replies View Related

Frameset Resizing

Aug 30, 2006

I have a frameset page as my index.html page and have noticed that if my
page is opened in other resolution than the one it was created in, some
pictures shift locatiuons.

If this was a non frames page i knew how to fix it...
Is there any was to automaticaly resize a frameset proportionaly to the
screen resolution?

ex: i want one picture to be exactly 1/4 of the screen, in a one-page i
would do someting like...

<img id="logo" border="0" src="Logotipo.jpg">
<script type="text/javascript">
document.getElementById("logo").width=screen.availwidth/4
document.getElementById("logo").height=screen.availheight/4
</script>

How do i do this with a frameset?
ex: banner frame be alway 1/6 of the screen height

View 2 Replies View Related

Image Resizing

Mar 19, 2007

We are code crushing the width of images from 285px to 260 pix.
However we aren't changing the height. we need a bit of javascript
that can make that percentage change to the height as well.

View 6 Replies View Related

Resizing Css Div In Javascript

Jul 20, 2005

I have a CSS div defined as follows :
<div id="col-2" >

In some circumstances I want to change its width.
I have tried all the following within a javascript function:

document.getElementById("col-2").width= "900";
document.getElementById("col-2").resizeTo(900, 520);
document.getElementById("col-2").width.value= "900";
document.all.col-2.resizeTo(900, 520);
document.layers["col-2"].resizeTo(900, 520);

None of which have worked.

Within the stylesheet I initially had col-2 defined as an ID. Clutching at
straws I changed it to a class but that made no difference.

Can someone point out the right way to do it?

View 3 Replies View Related

New Window Resizing

Oct 19, 2005

i have an imagemap, and i don't know where to write in the specific size for the new window popping up...if it's possible? i'm having just an "add to cart" page pop up and i don't need a big space..

<area shape="poly"#$36.95 decorated mixed
coords="590,313,431,309,430,325,565,334,581,315,581,313,581,313,581,313" href="b3695.html" title="$36.95 decorated mixed" target="_blank" />
<area shape="default" nohref="nohref" alt="" />
</map>

View 1 Replies View Related

Resizing Frames

Sep 25, 2003

I'm building a tool for my company and I'm making use of frames in it. I have one frame on the left side and two frames on the right side. I have two forms on the main frame (the left panel) and the user has an option to submit to either frame or to both frames.

I'm wondering: is there any way to resize the right bottom or right top frame via JavaScript if someone submits to only one of the frames?

View 2 Replies View Related

Resizing And Caching Images On The Fly.

Nov 8, 2006

I have a function which caches images for a slideshow once the script has loaded. Here is an exerpt:

var base_ref = "http://www.example.com";
var images = new Array();
var tmp_images = new Array();
tmp_images[0] = "image1.jpg";
tmp_images[1] = "image2.jpg";
tmp_images[2] = "image3.jpg";
tmp_images[3] = "image4.jpg";
tmp_images[4] = "image5.jpg";

function cache_images () {
for (var i=0; i < tmp_images.length; i++){
var cacheimage=new Image();
var tmp_name = tmp_images[i];
var url = tmp_images[i] + ".png";
cacheimage.src=url;
images[tmp_name]=cacheimage;
}
}

As it is, the script whizzes through the for loop, and then moves on to the next function. The only trouble is that it moves on to the next function whilst it's still downloading the images from the server. Is there anyway to make the script wait until the downloading is completed, so that I can then go on to resize the images if it's needed?

View 2 Replies View Related

Critique This Div Resizing Script

Nov 16, 2006

The below script sets and maintains the equal heights of 2 (or 3) divs which are floated next to each other on a page. I want to ensure that I have not overlooked anything and it will not error. In other words, it either executes successfully or not at all. This script is a compilation of code found on various posts along with my personalization thrown in to meet our specs. Note that this is just a "nice to have" script so if it doesn't execute the page is still usable .....

View 4 Replies View Related

Button Resizing In Opera

Jul 20, 2005

How can I dynamically resize a button in Opera?

The following code works for both IE 5.5 and NN 6.1, but Opera 7.01 is not budging...

View 2 Replies View Related

Resizing Iframes On Click?

Dec 1, 2009

I run a streaming site and am looking to have the option on a chat room next to the stream. Not everyone likes having the chat facility so I'd like to make it optional.

As the page loads I'd like the content to look like the diagram below with the stream (iframe1) taking up 95% of the page and the other 5% being taken up by an image which will say "open chat". The chat (iframe2) would have a width of 0%. [URL]

Then when the "open chat" image is clicked I'd like the chat (iframe2) to become 35% and the stream (iframe1) to become 60%. If someone could make a nice sliding effect when the image is clicked that'd be even better. Here's a diagram to show what it'd look like with the resized iframes. [URL]

View 1 Replies View Related

Textarea Resizing A Table ?

May 17, 2011

I have made a table with a textarea that is resizable. The problem is that when it resizes, it also resizes the table row and columns. Is there a way to fix this? Maybe a way to resize from the right side and bottom of the textarea only.

View 2 Replies View Related







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