•
•
•
•
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 373,457 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 3,976 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: 356 | Replies: 0
![]() |
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";
}
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
MCAD.NET
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
call c# through javascript creating watermark images on the fly cross-browser javascript menu with few lines of code firefox html javascript javascript delete all rows from table in javascript show overflow of text by "..." javascript smooth scrolling scroll smoothly window document position javascript tab menu with rounded corners generator output caching doesnt seem to work when its location set to client or downstream prevent javascript menu from getting hidden under flash movies preventing the delay when src attribute of the images set via javascript
- Previous Thread: start-date end-date Validation
- Next Thread: Firefox background-position problem solved


Linear Mode