display image on mouse over?

Discussion in 'JavaScript' started by dawilster, Dec 30, 2008.

  1. #1
    Im really interested in how templatemonster.com did it, you know when you rollover a template and an image appears or a preview what code did they use to get that affect?

    thanks alot
     
    dawilster, Dec 30, 2008 IP
  2. manjifera

    manjifera Well-Known Member

    Messages:
    232
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    118
    #2
    <html>

    <head>
    <script language="javascript" type="text/javascript">
    function show()
    {
    document.getElementById("img1").innerHTML = "<img src=\"https://www.google.com/adsense/static/en_GB/images/google_sm.gif\" border=\"0\">";
    }

    function hide()
    {
    document.getElementById("img1").innerHTML = "Hidden";
    }
    </script>
    <title>works gr8</title>

    </head>

    <body>

    <a onMouseOver="show()" onMouseOut="hide();"><div id="img1">Hello</div></a>

    </body>

    </html>

    working nice i guess you need this!
     
    manjifera, Jan 3, 2009 IP
  3. dawilster

    dawilster Active Member

    Messages:
    844
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #3
    thanks alot i really appreciate the effort.
     
    dawilster, Jan 3, 2009 IP