User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 422,405 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,868 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 426 | Replies: 0
Reply
Join Date: Jan 2008
Location: Largo Florida
Posts: 269
Reputation: serkansendur is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 23
serkansendur's Avatar
serkansendur serkansendur is offline Offline
Posting Whiz in Training

Preventing the delay when src attribute of the images set via javascript

  #1  
Mar 11th, 2008
When you assign a source to an image via javascript, it will take sometime to load the image. To get around this problem you can preload the images creating virtual images via javascript as follows :

if(document.images)
{
// create a virtual image
var img1 = new Image();
// preload the source
img1.src = "images/masterpage/menu_1_hover.jpg";
var img2 = new Image();
img2.src = "images/masterpage/menu_1.jpg";
}
Serkan Şendur
MCAD.NET
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 9:14 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC