Faqts : Computers : Programming : Languages : JavaScript : Images

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 6 people (67%) answered Yes
Recently 4 of 6 people (67%) answered Yes

Entry

How do I change an image in one frame named "leftFrame", when another frame, "rightFrame", loads

Nov 26th, 2002 07:55
Jean-Bernard Valentaten, Pete Ruby,


Let's say you have a function in the document of leftFrame called 
changePic
function changePic()
{
  //code to change pic
}
In the onUnload-handler of the documents in rightFrame you could then 
do this:
<body ... onUnload='window.parent.leftFrame.changePic();'>
This would call the function changePic in leftFrame and thus change 
the pic in leftFrame, when the document in rightFrame is unloaded.
Basically you can call any function and read/write any variable 
through the whole frameset (even in nested framesets), by knowing 
their object-path.
HTH,
Jean