www.webdeveloper.com
Results 1 to 2 of 2

Thread: Display image based on link

  1. #1
    Join Date
    Sep 2007
    Posts
    1

    Display image based on link

    I am sure this is vey easy, but I have not done much with javascript.

    I am trying to show the 'buttonOver' image if I am on that page.



    <a href="/FI/fiApprovals.asp"><div class="button" onMouseOver="this.className='buttonOver';" onMouseOut="this.className='button';">Approvals</div>

    I appreciate any help.
    Thanks,

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Can be done with css:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <title>css rollover image</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    <style type="text/css">
    a.button {
    display:block;
    background:#9cf url(outImage.jpg) no-repeat;
    width:100px;
    height:30px;
    }
    a.button:hover {
    background:#9cf url(overImage.jpg) no-repeat;
    }
     
    </style>
    
    </head>
    <body>
    <a href="/FI/fiApprovals.asp" class="button">Approvals</a>
    </body>
    </html>
    At least 98% of internet users' DNA is identical to that of chimpanzees

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles