Solved

Image change onmouse over

Posted on 2009-04-05
2
311 Views
Last Modified: 2012-05-06
I'm using attached code to change the image when mouse point over the image.

The problem is, when mouse is over the image, it downloads the image from server, and then change. I mean it takes a bit of time to change.

Is it possible both image will load when page the page gets loaded. and it will change image immediately when mouse over the image.
<img src="img-0.GIF" onmouseover="this.src='img-1.GIF';" onmouseout="this.src='img-0.GIF';">

Open in new window

0
Comment
Question by:marchent
2 Comments
 
LVL 39

Accepted Solution

by:
Roger Baklund earned 500 total points
Comment Utility
Yes, you can preload the image with javascript, for instance:

img = new Image();
img.src = "img-1.GIF";
0
 
LVL 13

Author Closing Comment

by:marchent
Comment Utility
sounds nice to me.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now