Results 1 to 5 of 5

Thread: Javascript help

  1. #1

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407

    Talking Javascript help

    How do you make a picture change when the mouseover event occurs?

  2. #2
    Code:
    <a href="someplace.html"
        onMouseOver="document.images['myimage'].src='hot.gif'"
        onMouseOut="document.images['myimage'].src='cold.gif'"
    ><img name="myimage" src="cold.gif"></a>

  3. #3
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    A better way is to create an array of images, in a function or not, (so long as it is created at runtime) and use a function to swap the image from this array. This guarantees (virtually) that the images will all load before you try a mouseOver event, so the effect is faster and smoother.

    Go to http://www.endeavour.net.au/index2.html and take a look at the code in the left menu frame. That is a working one, I can't be stuffed duplicating it now...
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  4. #4
    Lively Member sandin's Avatar
    Join Date
    Nov 2001
    Location
    From Your Heart!!!!
    Posts
    68

    Try This!!!

    Get a two Layer place a diffrent picture in it ..
    then in set a behaviour that on mouse over show one image and on mouse out second image...

    sandin

  5. #5
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    What do you mean by two layer? I'm not familiar with that one. IS it as *searching for appropriate word* usable(??) as JavaScript image.src swaps? That is, will as many browsers recognise it?
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width