Current location: Hot Scripts Forums » Programming Languages » ASP » Preload images but...


Preload images but...

Reply
  #1 (permalink)  
Old 12-05-05, 12:43 PM
ianric ianric is offline
Newbie Coder
 
Join Date: Nov 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Preload images but...

Hi

I have the following script to preload images in the <head> section which works great. When I pick on an image, a new window opens up with a Loading... then the image is displayed full size

<SCRIPT LANGUAGE="JavaScript">

var aryImages = new Array(3);

aryImages[0] = "../covers/ImageA.jpg";
aryImages[1] = "../covers/ImageB.jpg";
aryImages[2] = "../labels/ImageC.jpg";

for (i=0; i < aryImages.length; i++) {
var preload = new Image();
preload.src = aryImages[i];
}

</script>

Here's the but... But I need the ImageA.jpg, ImageB etc to be an ASP variable <% = Var %> or something.

Can this be done??

TIA

Ian
Reply With Quote
  #2 (permalink)  
Old 12-05-05, 07:07 PM
koncept
Guest
 
Posts: n/a
since asp is run before the javascript or html is run, you can use a loop inside that javascirpt to list out all the images and it should work fine
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache/PHP not displaying images mdhall PHP 4 01-28-06 01:01 PM
Royalty free cartoon images: Please reply mcrob The Lounge 2 10-04-05 09:40 AM
How to preload images cheenu1979 JavaScript 1 02-24-05 07:29 AM
Rotating Text Links & Images daily... J-Deak Script Requests 5 02-13-05 05:06 PM
List images and zip before download jaimexyz Script Requests 0 09-01-03 03:01 PM


All times are GMT -5. The time now is 03:36 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.