| Business Forum | Buy, Sell & Trade | Search Engine Forum | Domains & Webhosting |
| |||||||
| REMOVE the ads below ! |
![]() |
| | LinkBack | Thread Tools |
| |||
|
01-20-2008
I still didn't understand logic behind this. Directory forum| Webmaster Zone| Directory Point | Dierctory Blog PR4Bidding Directory | Blog of India If Shadab is solution....I need my question back... | |||
|
| |||
|
01-20-2008
Okay. I'll explain it a bit more this time... Picture this : Suppose a navigation menu has an image with the name "image1.gif" and its corresponding rollover image as "image1_roll.gif". On the full page load, only "image1.gif" will be 'called' by the browser. When the user moves his mouse over that image, the browser now fetches another image "image1_roll.gif". On slow connections, this would cause a delay of a second or two, before that "image1_roll.gif" is downloaded and displayed. Heres how the given javascript is useful. In the following javascript code : Preload1 = new Image(); Preload1.src = "image1_roll.gif"; First we declare an object Preload1 to be an image. In the second like, we assign it the image source of "image1_roll.gif". This makes the browser to call the "image1_roll.gif" image beforehand, and download it & save it in the browser cache. (Not display it right there) Now when the user moves his mouse over "image1.gif", the rollover image gets displayed 'immediately" without any delay. Because the rollover image has been already downloaded and cached previously by that javascript. This results in a smooth rollover effect. | |||
|
![]() |
| Thread Tools | |