SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast swollenpickles's Avatar
    Join Date
    Jul 2007
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    image with text rollover

    I'm wondering if this effect can be created with javascript:
    http://www.scorereviews.com/default.aspx

    When I mouseover an image, I'd like text to appear that gives the title of that image, and author, the same way that it occurs when you run the mouse over the cd covers on the site above.

    Is this possible to do with javascript? If so how?

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <title>Untitled Document</title>
            <link rel="stylesheet" type="text/css" media="screen" />
            <style type="text/css"></style>
            <script type="text/javascript">
                function displayMessage(msg) {
                    document.getElementById('text').innerHTML = msg;
                }
                function clearMessage() {
                    document.getElementById('text').innerHTML = '';
                }
            </script>
        </head>
        <body>
            
            <img src="http://sitepointstatic.com/images/new/logo.gif" onmouseover="displayMessage('I am the Sitepoint Logo... <br />Woo Hoo!');" onmouseout="clearMessage()"; /><img src="http://www.sitepoint.com/images/layout/gradient4r.gif" onmouseover="displayMessage('Something Random!');" onmouseout="clearMessage()"; />
            <br /><br /><div id="text"></div>
    
        </body>
    </html>


  3. #3
    SitePoint Enthusiast swollenpickles's Avatar
    Join Date
    Jul 2007
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much! That's what I was after!


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
  •