MouseOver in frames

C

Com Dot

In a frameset, the menu frame has six buttons. I would like to use
mouseOver on these buttons to make images change in another frame.
Does anyone have a script or know of a working site where this is used?

Any help is appreciated.

Thanks,

Com
 
R

Random

Com said:
In a frameset, the menu frame has six buttons. I would like to use
mouseOver on these buttons to make images change in another frame.
Does anyone have a script or know of a working site where this is used?

Any help is appreciated.

Thanks,

Com


There is a plethora of syntactical ways to do this, but logically
they're all pretty much the same:

Use the document.frames collection to identify the frame you'd like to
address, then work with it as you would any other window.

You might want to Google it or find JavaScript and DOM documentation
that pleases you. There are also many excellent tutorials out there
that you may find valuable.

Some generic examples follow:

document.frames[ myFrame ].document.images[ myImage ].src =
'images/aPicture.pic';

------

with( document.frames[ myFrame ] ) {
document.images[ myImage ].src = 'images/aPicture.pic';
// other things you want to do in the frame
}

------

pictureFrame = document.frames[ myFrame ];
pictureFrame.document.images[ myImage ].src = '...';

------

picture = document.frames[ myFrame ].document.images[ myImage ];
picture.src = '...';

------

You may also (in some cases) refer to the frame directly, though this
is bad practice:
<frame name=PictureFrame id=PictureFrame ... />

PictureFrame.document.images[ myImage ].src = '...';

------

Alternative to the document.frames and document.images collections, you
may use the document.getElementById method. Don't, though.



Again, there's a wealth of excellent tutorials out there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top