Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2006
    Location
    Australia
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Image mouseover, Please help can't do!!

    Hello,
    I know that this is probably basic stuff for most of you but I have tried many different codes to achieve a image mouseover and not one has worked.

    this is the first one that I tried


    <SCRIPT LANGUAGE="javascript">

    <!--


    t4=new image(112,150)
    t4.src="tes1.jpg"

    2t4=new image(112,150)
    2t4.src="Tes2.jpg"



    //-->

    </SCRIPT>


    </HEAD><BODY>

    <center>

    <A HREF="page2b.html" ONMOUSEOVER="document.TessaT4.src=t4.src" ONMOUSEOUT="doucment.TessaT4.src=2t4.src">

    <IMG SRC="tes1.jpg" NAME="TessaT4">
    </A>

    </body>
    all I got was my first image and nothing happened.

    I have tried a JavaScript code generator and got nothing, not even an image. on the page.
    I have tried many different ways of doing this and still nothing.

    Any help would be great
    Thanks Erica

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,918
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    You will find a good tutorial with examples at:-

    http://www.htmlcenter.com/tutorials/...79/Javascript/

  • #3
    New Coder
    Join Date
    Mar 2006
    Location
    Australia
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for that Phillip,
    It kind of works, when the page first loads I get the little red x where the image is and then when I move my mouse over the spot the image comes up and changes.
    this is the code
    <html>
    <head>
    <title>JavaScript Image Rollovers</title>
    <script>
    <!-- Hide Script
    function move_in(img_name,img_src) {
    document[img_name].src=img_src;
    }

    function move_out(img_name,img_src) {
    document[img_name].src=img_src;
    }
    //End Hide Script-->
    </script>
    </head>
    <body>
    <a href="#"
    OnMouseOver="move_in('image1','tes2.jpg')"
    OnMouseOut="move_out('image1','tes1.jpg')">

    <img src="tes2.jpgf"
    alt="Tessa T4" name="image1">

    </a>
    </body>
    </html>

    I will work on it some more to see if I can solve the problem .
    Does anybody have any ideas as to where I went wrong????

    Thanks again Erica

  • #4
    New Coder
    Join Date
    Mar 2006
    Location
    Australia
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Found the problem a simple typo silly me..
    Thanks Phillip again

    Erica


  •  

    Posting Permissions

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