Solved

change IFrame image size from parent

Posted on 2007-04-07
4
1,813 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
i had a syntax error. your solution worked.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

763 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

9 Experts available now in Live!

Get 1:1 Help Now