Saturday 24 September 2011

Swap Image across frames...?

How about this...? Suppose you have a %26lt;iframe%26gt; tag on our page. Inside it, there is a picture. Now you want to change another picture, that is located in the main page (outside the %26lt;iframe%26gt;, while you move your mouse over your image in the frame. I've tried to apply the swap image behavior to the name of the image in the main page .. it did not work. Is there some trick how to do it? Thanks.
Swap Image across frames...?
You may not be able to do this outright do to security settings associated with iframes. However, if you can then you'll have to access the element you want to change (the one in the parent frame) by walking up the DOM. Something like window.parent.getElementById (%26quot;myImage%26quot;).src = otherImage