Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Help with Rollover Image Swap!

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #29129
    Webbie
    Member

    Hey!

    So I’m a newbie at JavaScript, and I’m having trouble using JavaScript to enable a mouseOver, mouseOut code. I am attempting to replace an image with another image.

    Here is my code:

    Code:






    TAH Background Essays for Students Image


    Can anybody please help me? I do not get what I am doing wrong.

    #76387
    mdrd
    Participant

    Try something like this.

    the html:

    <div id="mydiv">
    </div>

    The css:

    #mydiv {

    background-image: img1.jpg;

    }

    #mydiv:hover {

    background-image: img2.jpg;

    }

    No javascript required ;)

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.