Jump to content

JavaScript Image Animation


LaLaLa

Recommended Posts

What I have right now:On my site, I have three thumbnails and one large image. When you hover over one of the thumbnails, the large image should be replaced by a big version of the thumbnail. Right now, I have some simple JavaScript code that, when you hover over the thumbnails, will change the URL of the big image to the larger version of the thumbnail.My actual question:If I have it set up this way, when you hover over a different thumbnail, will the browser load the new image then, or will it automatically load it when it first sees the address in the code? I can't tell this because I have cable internet and it goes to fast, I'm mainly just talking about dial-up's...My webpage code:

<html><head><script type="text/javascript"><!--function thumbnail1(){document.mybigpicture.src="big_image_1.jpg"}function thumbnail2(){document.mybigpicture.src="big_image_2.jpg"}function thumbnail3(){document.mybigpicture.src="big_image_3.jpg"}//--></script></head></body>My big image goes here:<img src="some.website.address.jpg" name="mybigpicture">Thumbnails are here:<img src="some.website.address2.jpg" onmouseover="thumbnail1()"><img src="some.website.address3.jpg" onmouseover="thumbnail2()"><img src="some.website.address4.jpg" onmouseover="thumbnail3()"></body></html>

Link to comment
Share on other sites

My actual question:If I have it set up this way, when you hover over a different thumbnail, will the browser load the new image then, or will it automatically load it when it first sees the address in the code? I can't tell this because I have cable internet and it goes to fast, I'm mainly just talking about dial-up's...
The browser will load it after the function is called, so yes there will be a delay for slower machines.Enter javascript Image Preloading - that's your solution for this :)
Link to comment
Share on other sites

The browser will load it after the function is called, so yes there will be a delay for slower machines.Enter javascript Image Preloading - that's your solution for this :)
OK! Thanks for the help... :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...