|
|
Or, use your gamerDNA username: (more...)
| ||||||
| |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
| | #1 (permalink) |
| Registered User Join Date: May 2003
Posts: 313
+9 Internets | Javascript question This might be a bit ambiguous but I can't get google to help me out at all on this one. When my page loads, I initialize an array, lets call it 'theImages'. After the page loads, I run a function that loads 20 images into this array. I have an image object on the page that can loop through these images in order, with Next, Previous, and Animate buttons. The load function runs once, and calls another function that loops through the array and checks if each file is finished downloading using something like if(theImages[i].complete == true) where i is an integer in a for loop from 1 to 20. The function then writes a percent complete line to another element on the page and then calls itself via setTimeout. When the images are finished loading, the setTimeout is no longer called. While the images are loading, the next/previous/animate buttons work, the object just doesn't display any images that haven't loaded yet. Problem is, once I press any of those buttons, whether the requested image has loaded or not, the percent text shoots to 100% and claims that the loading is done, but the images continue loading in the background (and is evident by the "transferring data from..." status bar text). My theory is that using something like this line, document.getElementByID("main_image").src = theImages[next_image].src causes the browser to assume that all images inside the array are complete for some reason. This is true for both IE7 and Firefox. I can't find anything on google to confirm this theory though, and can't find any solution or alternative for what I'm trying to do. If anyone can help me with this it would be greatly appreciated. |
| | |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
| |