MouseOver in frames

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Com Dot

    MouseOver in frames

    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

  • Random

    #2
    Re: MouseOver in frames

    Com Dot wrote:[color=blue]
    > 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[/color]


    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.image s[ 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.do cument.images[ myImage ].src = '...';

    ------

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

    ------

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

    PictureFrame.do cument.images[ myImage ].src = '...';

    ------

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



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

    Comment

    Working...