?
Solved

change IFrame image size from parent

Posted on 2007-04-07
4
Medium Priority
?
1,829 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 400 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

Industry Leaders: 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

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 …
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

755 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