SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Nov 2003
    Location
    Brisbane, Australia
    Posts
    408
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rollover Text To Change Image

    Hi All

    I'm not that great with JavaScript and would really appreciate being pointed in the direction of example script I can use to do the following.

    Essentially I have text on the left (sizes) and an image on the right.

    When you put your mouse over the text the image needs to change to show the corresponding image to the text.

    I know this isn't hard but I just mustn't be using the right search terms to find an example.

    Thanks for any help.

    mrmbarnes

  2. #2
    SitePoint Evangelist
    Join Date
    Nov 2003
    Location
    Brisbane, Australia
    Posts
    408
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With no reply and heaps more searching I have found this which is perfect.

    Hope it helps someone else in the future.

    <html>
    <head>

    <SCRIPT LANGUAGE="JAVASCRIPT">
    <!--

    function roll(img_name1, img_src1)
    {
    document[img_name1].src = img_src1;
    }

    //-->
    </SCRIPT>
    </head>

    <body>

    <ul>
    <li><a href="1.htm" onmouseover="roll('poster', '1.gif')">111</a>
    <li><a href="2.htm" onmouseover="roll('poster', '2.gif')">222</a>
    <li><a href="3.htm" onmouseover="roll('poster', '3.gif')">333</a>
    </ul>

    <br><br><br><br>

    <p align="center"><img src="1.gif" name="poster"></p>

    </body>
    </html>


Bookmarks

Posting Permissions

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