?
Solved

asp mouseover image

Posted on 2008-10-26
3
Medium Priority
?
289 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Accepted Solution

by:
Shahzad Fateh Ali earned 1000 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 1000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…
Suggested Courses

765 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