Solved

asp mouseover image

Posted on 2008-10-26
3
280 Views
Last Modified: 2009-02-02
I've used mouseover and hover for a long time, but over text, not on an image.
I'm thinking you have to have as many images as you do menu options that you want to change color on mouseover, but don't have a clue how to code it  I'm using an image map for href now.  It's in simple asp and javascript/vbscript.
Any examples would be appreciated - looking for cleanest, easiest to understand so anyone can maintain.
I know it's probably easier in AJAX, knowing how it works, but haven't used it yet.  Maybe this is the time.
0
Comment
Question by:dcass
3 Comments
 
LVL 9

Accepted Solution

by:
Shahzad Fateh Ali earned 250 total points
ID: 22810392
Hi,

Try this.

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Simple Roll Over</title>
<script type="text/javascript" language="javascript">
	function rollover(el, img){
		el.src = img;
	}
</script>
</head>
<body>
<img src="ad.gif" onmouseover="rollover(this,'af.gif')" onmouseout="rollover(this,'ad.gif')" />
</body>
</html>

Open in new window

0
 
LVL 7

Assisted Solution

by:Garve
Garve earned 250 total points
ID: 22817909
Rather than using javascript, this can all be done with one image and CSS - A List Apart has the code.

See
http://www.alistapart.com/d/sprites/ala-buttons1.html

You presumable already have your image for your image map.
In an image editor, make it twice as deep, and add your hover states below.

This shows the image in the above demo - it'll help you understand much more quickly.
http://www.alistapart.com/d/sprites/icons.gif

You use the image as the background to each of the links, moving it using CSS as required. On hover the CSS 'jumps' the image up.

The full article is
http://www.alistapart.com/articles/sprites

0
 

Author Comment

by:dcass
ID: 23534075
Turns out I didn't end up having to do this but will award the points because from what I know, the solution looks quite good.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question