Solved

change IFrame image size from parent

Posted on 2007-04-07
4
1,816 Views
Last Modified: 2012-05-05
IE 7

I have an IFrame with an image in it. From the parent of the IFrame I need to change the width and height of the image. Here is the image:

<img id='picid' name='picname'  src='whatever.jpg">

what is the jscript in the parent to change the pic size?
thanks
0
Comment
Question by:steve44
  • 3
4 Comments
 
LVL 58

Accepted Solution

by:
amit_g earned 100 total points
ID: 18870636
If you have only one iframe, you can use

window.frames[0].getElementById("picid").src = "whateverNew.jpg";

If you have more than one iframe and/or frames, you need to use name of the iframe

window.frames["IFrameName"].getElementById("picid").src = "whateverNew.jpg";
0
 

Author Comment

by:steve44
ID: 18870797
I want to change the size so I tried:

window.frames["IFrameName"].getElementById("picid").style.width=100;

gives error:  object does not support this property or method
0
 

Author Comment

by:steve44
ID: 18870935
I should add that the main page is an HTA file but in the iframe tag i have application='yes'.
0
 

Author Comment

by:steve44
ID: 18872642
i had a syntax error. your solution worked.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jQuery Popover 4 372
Javascript onReadyStateChange event not fire for XMLHttpRequest object? 2 260
sort JSON using parameters from links 2 96
CRM 2011 Opportunity Bug 18 141
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

932 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

10 Experts available now in Live!

Get 1:1 Help Now