image:onmouseover

javascript United States
  • 18 years ago

    I'm really beginner in javascript.So PLEASE give me details.


    I have two images.I want when mouse go over one of them another one become invisible and  when it goes out of it again it become visible.

  • 18 years ago

    have a gander at this, i wrote it myself so if u dont understand just bell me


    http://www.hjones.freeuk.com/imagerollover.htm

  • 18 years ago

    [courier new]
    <img src ="something.gif" onMouseOver ="this.src='something_else.gif';" onMouseOut ="this.src='something.gif';">
    [/courier new]


    and to preload the image(s)


    [courier new]
    var image1 = new Image(); image1.src = "image1.gif";
    var image2 = new Image(); image1.src = "image2.gif";
    var image3 = new Image(); image1.src = "image3.gif";
    [/courier new]


    since that's repetitive code, if you're doing more than just a few, you should use a loop, but that's digressing too far i think


    i hope that's what you wanted

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Linux is only free if your time has no value” - Jamie Zawinski