Solved

Setting new Height and Width over iframe

Posted on 2011-03-21
7
212 Views
Last Modified: 2012-05-11
Hello,

For example, when i use an iframe, example

<iframe src="somesite">your browser doesnt support iframes</iframe>

ok, but the source (somesite) has your own width and height and how to update on the client (the page that will show the iframe content) the exact size of the source (somesite in this case)?

example,

index.html will host the iframe content
content.html is the iframe content

index.html should show in an iframe, the content.html but with it exactly size... no matter the width or height of the content, index.html will adjust it...

some idea?

Regards,
Carlos
0
Comment
Question by:cebasso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 35180518
try something like this

<iframe src="somesite" style='width:100px;height:150px;'>your browser doesnt support iframes</iframe>
0
 
LVL 4

Author Comment

by:cebasso
ID: 35180579
but setting the width and height, will make my iframe 100px x 150px with scrollbars

there is a way to automatically set the "content.html" width and height without being static?

i mean, doesnt matter the width and height of the content... iframe will adjust automatically
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 35180597
<<there is a way to automatically set the "content.html" width and height without being static?>>
what does this mean?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 35180956
0
 
LVL 82

Expert Comment

by:leakim971
ID: 35180970
0
 
LVL 4

Author Comment

by:cebasso
ID: 35184095
Thank you all for help, anyway there is no working example since my iframes is cross domain...
many erros like "Permission denied"...

but i found this that really work

http://geekswithblogs.net/rashid/archive/2007/01/13/103518.aspx

Works perfectly cross domain too... except in Google Chrome that keep refreshing the page forever...

the link below i'm using to test... it already contains all scripts from link above...

http://loja.tray.com.br/loja/produto.php?loja=233895&IdProd=1414

Will resize perfectly except in Chrome like i said above...

anyone know how to fix it?

Regards
0
 
LVL 4

Author Closing Comment

by:cebasso
ID: 36338673
Thank you!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Date on a table 16 34
SVG and IE11 2 17
Html split(text) 2 28
Javascript: Mouseup doesn't follow mousedown 13 29
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

749 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