• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • Last Modified:

iframe

i have:

index.html-

<html>
..
..
..
<img src="one.jpg" name="picture">
..
..
<ifram src="frame.html"></iframe>
..
</html>



in my frame.html, i have
<img src="m.jpg" onClick="????">

in this case, i want the ???? to be : when i click on that image m.jpg, then "picture" 's source will change to m.jpg.
how do i do that?

I know that if its without iframe, then i can have ???? -> picture.src='m.jpg'. this doesnt seem to work with iframe tho..
any solution?

0
sutejok
Asked:
sutejok
  • 3
  • 2
1 Solution
 
william007Commented:
In the index.html
<html>
<body>
<iframe src="frame.html"></iframe>
</body>
</html>

In Frame.html
<img src="Winter.jpg" onclick="javascript:this.src='sunset.jpg'"/>

I test it in index.html...it works well...Is it what u want?
0
 
COBOLdinosaurCommented:
<img src="m.jpg" onClick="parent.images['picture'].src=this.src">

Cd&
0
 
sutejokAuthor Commented:
william007  -  
in this case, i want the ???? to be : when i click on that image m.jpg, then "picture" 's source will change to m.jpg.
how do i do that?

"picture" is the name of the image from the main frame.. sorry for the unclear statement


Cd& -
the image in the parent frame doesnt change..

thx guys
0
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!

 
COBOLdinosaurCommented:
Yeah I guess we need the reference to the document object in there:
 
<img src="m.jpg" onClick="parent.document.images['picture'].src=this.src">

Cd&
0
 
sutejokAuthor Commented:
thx
0
 
COBOLdinosaurCommented:
Glad we could help.  Thanks for the A. :^)

Cd&
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now