www.webdeveloper.com
Results 1 to 2 of 2

Thread: Changing Button Image When Clicked

  1. #1
    Join Date
    May 2012
    Posts
    1

    Changing Button Image When Clicked

    Okay, this is my first post on these forums so I hope this is the appropriate place to ask this question.

    I'm working on my final for my Web design class and I would like to have the buttons that I have made in Photoshop when clicked switch to the clicked versions I have made of them. Also when they are clicked they will be linking to another page. If anybody could post some example code for me or if you could give me a link to a page that clearly explains this I would really appreciate it.

    I'm sorry if I'm sounding rude asking for this but I have to have my final in within the next thirty six hours or so.

    Any help is greatly appreciated.

    -Shane

  2. #2
    Join Date
    Jun 2004
    Location
    Portsmouth UK
    Posts
    2,645
    if you click the image it will link directly so the image swap
    is wasted
    mouseover example

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
    </head>
    
    <body>
    <a href="URL1.htm" ><img src="http://www.vicsjavascripts.org.uk/StdImages/Egypt5.jpg" alt="egypt" border="0" 
    onmouseover="this.src='http://www.vicsjavascripts.org.uk/StdImages/Egypt6.jpg';this.parentNode.href='URL2.htm'; "
    onmouseout="this.src='http://www.vicsjavascripts.org.uk/StdImages/Egypt5.jpg';this.parentNode.href='URL1.htm'; "
     /></a>
    </body>
    
    </html>
    Vic

    God loves you and will never love you less.

    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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