Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

JavaScript HTML help!?

I found this cool feature, I don't know what it is called, but it may be a part of HTML, JavaScript or something, so I wanted to know,:

a: How can you make an image change into another when pointed by cursor.

b: What code should I add to do this?

Here's an example, move your cursor in the "Learn to Play" image.:

http://www.yugioh-card.com/en/

Best answer has a sure 10-points! TY in advance ^_^

6 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    That is javascript:

    <img src="Bonsai.gif" alt=my image is cool"

    onmouseover="this.src='Koi.gif'" onmouseout="this.src='Bonsai.gif'" />

    You change to the new image onmouseover and then back to the original on mouseout

  • ?
    Lv 4
    5 years ago

    For a basic definition, HTML is hyper-text markup language and JavaScript is a scripting language that was released by Sun Microsystems. To be a little more specific- if you view the source code on a website which can be easily done with most browsers, the tags that are between the '<>' brackets are HTML tags. HTML is a basic language used to lay out website templates. JavaScript is a step above HTML. JavaScript's code gets away from tags and greatly resembles many object-based languages. Its one of a few scripting languages that are commonly used to spruce up a website and add many of those cool little effects that you see on most of today's websites. The bottom line - HTML is required to make a website, even a basic one, whereas JavaScript is used to make sites more complex.

  • Bebo
    Lv 4
    1 decade ago

    That's java called onmouseover and onmouseout events

    the link goes to a code with example

  • Anonymous
    1 decade ago

    1: Google is your friend, learn to use it.

    2: If you don't know how to find out, you really shouldn't be coding a website.

    3:

    inside script tags, in the source code of the page you linked, you can easily see:

    sfHover = function() {

    var sfEls = document.getElementById("nav").getElementsByTagName("li");

    for (var i=0; i<sfEls.length; i++) {

    sfEls[i].onmouseover=function() {

    this.className+=" sfhover";

    }

    sfEls[i].onmouseout=function() {

    this.className=this.className.replace(new RegExp(" sfhover\\b"), "");

    }

    }

    }

    if (window.attachEvent) window.attachEvent("onload", sfHover);

    so it's fairly clear how they did it.

    Next time, view the source before asking stupid questions.

  • How do you think about the answers? You can sign in to vote the answer.
  • 1 decade ago

    <html>

    <HEAD>

    <SCRIPT LANGUAGE="JavaScript">

    <!-- Hide from older browsers

    function overmyimage() {

    document.images["myimage"].src = "image2.jpg";

    }

    function outmyimage(){

    document.images["myimage"].src = "image1.gif";

    }

    </SCRIPT>

    </HEAD>

    <body>

    Image mouse over answer

    <A HREF="javascript:void(0)" onMouseOver="overmyimage()"

    onMouseOut="outmyimage()"><IMG SRC="image1.gif" NAME="myimage"

    WIDTH=200 HEIGHT=200 BORDER=0></A>

    </body>

    </html>

    ***note

    Just replace image1.gif and image2.jpg with whatever pictures you want. Hope this helps.

    P.S. Mine is a lot easier lol

  • 1 decade ago

    You can do that with css too.

Still have questions? Get your answers by asking now.