SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict michaelwheaton's Avatar
    Join Date
    Jan 2001
    Location
    Alberta, Canada
    Posts
    338
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with a script...

    I need to write a javascript but I'm not that great with the language and would really like some help. I have a page with 20-30 thumbnail images and the idea is that when the user hovers on one of these a larger image is shown. So when one image is hovered on, another is changed. I hope that explained it clearly enough. I know how to do rollovers but this is a little different because it's not changing the image they hover on, but a different one. Any help would be greatly appreciated.

  2. #2
    SitePoint Zealot
    Join Date
    Apr 2001
    Location
    Toronto, Ontario, Canada, Earth
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this, my friend:

    <HTML>
    <BODY>
    <script language="JavaScript">
    function picture(x){
    document.mainpicture.src="b"+x+".gif";
    }
    </script>
    <CENTER>
    <IMG SRC="b1.jpg" WIDTH=100 HEIGHT=100 NAME="mainpicture">
    <CENTER><TABLE WIDTH="100%" BORDER=0 CELLPADDING=0>
    <TR>
    <TD>
    <CENTER>1</CENTER>
    <CENTER><A onMouseOver="picture(1);" HREF="JavaScript:picture(1)"><IMG SRC="s1.gif"></A></CENTER>
    </TD>
    <TD>
    <CENTER>2</CENTER>
    <CENTER><A onMouseOver="picture(2);" HREF="JavaScript:picture(2)"><IMG SRC="s2.gif"></A></CENTER>
    </TD>
    <TD>
    <CENTER>3</CENTER>
    <CENTER><A onMouseOver="picture(3);" HREF="JavaScript:picture(3)"><IMG SRC="s3.gif"></A></CENTER>
    </TD>
    <TD>
    <CENTER>4</CENTER>
    <CENTER><A onMouseOver="picture(4);" HREF="JavaScript:picture(4)"><IMG SRC="s4.gif"></A></CENTER>
    </TD>
    <TD>
    <CENTER>5</CENTER>
    <CENTER><A onMouseOver="picture(5);" HREF="JavaScript:picture(5)"><IMG SRC="s5.gif"></A></CENTER>
    </TD>
    </TR>
    <TR>
    <TD>
    <CENTER>6</CENTER>
    <CENTER><A onMouseOver="picture(6);" HREF="JavaScript:picture(6)"><IMG SRC="s6.gif"></A></CENTER>
    </TD>
    <TD>
    <CENTER>7</CENTER>
    <CENTER><A onMouseOver="picture(7);" HREF="JavaScript:picture(7)"><IMG SRC="s7.gif"></A></CENTER>
    </TD>
    <TD>
    <CENTER>8</CENTER>
    <CENTER><A onMouseOver="picture(8);" HREF="JavaScript:picture(8)"><IMG SRC="s8.gif"></A></CENTER>
    </TD>
    <TD>
    <CENTER>9</CENTER>
    <CENTER><A onMouseOver="picture(9);" HREF="JavaScript:picture(9)"><IMG SRC="s9.gif"></A></CENTER>
    </TD>
    <TD>
    <CENTER>10</CENTER>
    <CENTER><A onMouseOver="picture(10);" HREF="JavaScript:picture(10)"><IMG SRC="s10.gif"></A></CENTER>
    </TD>
    </TR>
    </TABLE></CENTER>
    </CENTER>
    </BODY>
    </HTML>
    let me know if this is what you wanted.

    Jason Weinstein
    http://www.MaximumEdge.com/


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
  •