![]() |
| ||
| Preventing the delay when src attribute of the images set via javascript 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"; } |
| All times are GMT -4. The time now is 1:46 am. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC