473,806 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I get code to access the images at the URL given?Array Question

tpgames
785 Contributor
How do I get code to access the images at the URL given?
I'd like the user to be able to select which theme of images they want to view then the script would randomly pick an image to show.

Expand|Select|Wrap|Line Numbers
  1. <!--BEGIN
  2. // Customising Variables
  3.  
  4. // Arrays of Images that can be used in the game
  5. var ImgAry=['1.jpg','2.jpg','3.jpg','4.jpg','5.jpg','6.jpg','7.jpg','8.jpg','9.jpg','10.jpg','11.jpg','12.jpg','13.jpg','14.jpg','15.jpg','16.jpg','17.jpg','18.jpg','19.jpg','20.jpg','21.jpg','22.jpg','23.jpg','24.jpg','25.jpg','26.jpg','27.jpg','28.jpg','29.jpg','30.jpg','32.jpg','33.jpg','34.jpg','35.jpg','36.jpg','37.jpg','38.jpg','39.jpg','40.jpg','41.jpg','42.jpg','43.jpg','44.jpg','45.jpg','46.jpg','47.jpg','48.jpg','49.jpg','50.jpg','51.jpg','52.jpg','53.jpg','54.jpg','55.jpg','56.jpg','57.jpg','58.jpg','59.jpg','60.jpg','61.jpg','62.jpg','63.jpg','64.jpg','65.jpg','66.jpg','67.jpg','68.jpg','69.jpg','70.jpg','71.jpg','72.jpg','73.jpg','74.jpg','75.jpg','76.jpg','77.jpg','78.jpg','79.jpg','80.jpg','81.jpg','82.jpg','83.jpg','84.jpg','85.jpg','86.jpg','87.jpg','88.jpg','89.jpg','90.jpg','91.jpg','92.jpg','93.jpg','94.jpg','95.jpg','96.jpg','97.jpg','98.jpg','99.jpg','100.jpg','101.jpg','102.jpg','103.jpg','104.jpg','105.jpg','106.jpg','107.jpg','108.jpg','109.jpg','110.jpg','111.jpg','112.jpg','113.jpg','114.jpg','115.jpg','116.jpg','117.jpg','118.jpg','119.jpg','120.jpg','121.jpg','122.jpg','123.jpg','124.jpg','125.jpg','126.jpg','127.jpg','128.jpg','129.jpg','130.jpg','131.jpg','132.jpg','133.jpg','134.jpg','135.jpg'];
  6. var ImgAry2=['1.jpg','2.jpg','3.jpg','4.jpg','5.jpg','6.jpg','7.jpg','8.jpg','9.jpg','10.jpg','11.jpg','12.jpg','13.jpg','14.jpg','15.jpg','16.jpg','17.jpg','18.jpg','19.jpg','20.jpg','21.jpg','22.jpg','23.jpg','24.jpg','25.jpg','26.jpg','27.jpg','28.jpg','29.jpg','30.jpg','32.jpg','33.jpg','34.jpg','35.jpg','36.jpg','37.jpg','38.jpg','39.jpg','40.jpg','41.jpg','42.jpg','43.jpg','44.jpg','45.jpg','46.jpg','47.jpg','48.jpg','49.jpg','50.jpg','51.jpg','52.jpg','53.jpg','54.jpg','55.jpg','56.jpg','57.jpg','58.jpg','59.jpg','60.jpg','61.jpg','62.jpg','63.jpg','64.jpg','65.jpg','66.jpg','67.jpg','68.jpg','69.jpg','70.jpg','71.jpg','72.jpg','73.jpg','74.jpg','75.jpg','76.jpg','77.jpg','78.jpg','79.jpg','80.jpg','81.jpg','82.jpg','83.jpg','84.jpg','85.jpg','86.jpg','87.jpg','88.jpg','89.jpg','90.jpg','91.jpg','92.jpg','93.jpg','94.jpg','95.jpg','96.jpg','97.jpg','98.jpg','99.jpg','100.jpg','101.jpg','102.jpg','103.jpg','104.jpg','105.jpg','106.jpg','107.jpg','108.jpg','109.jpg','110.jpg','111.jpg','112.jpg','113.jpg','114.jpg','115.jpg','116.jpg','117.jpg','118.jpg','119.jpg','120.jpg','121.jpg','122.jpg','123.jpg','124.jpg','125.jpg','126.jpg','127.jpg','128.jpg','129.jpg','130.jpg','131.jpg','132.jpg','133.jpg','134.jpg','135.jpg'];
  7. var ImgAry3=['1.jpg','2.jpg','3.jpg','4.jpg','5.jpg','6.jpg','7.jpg','8.jpg','9.jpg','10.jpg','11.jpg','12.jpg','13.jpg','14.jpg','15.jpg','16.jpg','17.jpg','18.jpg','19.jpg','20.jpg','21.jpg','22.jpg','23.jpg','24.jpg','25.jpg','26.jpg','27.jpg','28.jpg','29.jpg','30.jpg','32.jpg','33.jpg','34.jpg','35.jpg','36.jpg','37.jpg','38.jpg','39.jpg','40.jpg','41.jpg','42.jpg','43.jpg','44.jpg','45.jpg','46.jpg','47.jpg','48.jpg','49.jpg','50.jpg','51.jpg','52.jpg','53.jpg','54.jpg','55.jpg','56.jpg','57.jpg','58.jpg','59.jpg','60.jpg','61.jpg','62.jpg','63.jpg','64.jpg','65.jpg','66.jpg','67.jpg','68.jpg','69.jpg','70.jpg','71.jpg','72.jpg','73.jpg','74.jpg','75.jpg','76.jpg','77.jpg','78.jpg','79.jpg','80.jpg','81.jpg','82.jpg','83.jpg','84.jpg','85.jpg','86.jpg','87.jpg','88.jpg','89.jpg','90.jpg','91.jpg','92.jpg','93.jpg','94.jpg','95.jpg','96.jpg','97.jpg','98.jpg','99.jpg','100.jpg','101.jpg','102.jpg','103.jpg','104.jpg','105.jpg','106.jpg','107.jpg','108.jpg','109.jpg','110.jpg','111.jpg','112.jpg','113.jpg','114.jpg','115.jpg','116.jpg','117.jpg','118.jpg','119.jpg','120.jpg','121.jpg','122.jpg','123.jpg','124.jpg','125.jpg','126.jpg','127.jpg','128.jpg','129.jpg','130.jpg','131.jpg','132.jpg','133.jpg','134.jpg','135.jpg'];
  8. var ImgAry4=['1.jpg','2.jpg','3.jpg','4.jpg','5.jpg','6.jpg','7.jpg','8.jpg','9.jpg','10.jpg','11.jpg','12.jpg','13.jpg','14.jpg','15.jpg','16.jpg','17.jpg','18.jpg','19.jpg','20.jpg','21.jpg','22.jpg','23.jpg','24.jpg','25.jpg','26.jpg','27.jpg','28.jpg','29.jpg','30.jpg','32.jpg','33.jpg','34.jpg','35.jpg','36.jpg','37.jpg','38.jpg','39.jpg','40.jpg','41.jpg','42.jpg','43.jpg','44.jpg','45.jpg','46.jpg','47.jpg','48.jpg','49.jpg','50.jpg','51.jpg','52.jpg','53.jpg','54.jpg','55.jpg','56.jpg','57.jpg','58.jpg','59.jpg','60.jpg','61.jpg','62.jpg','63.jpg','64.jpg','65.jpg','66.jpg','67.jpg','68.jpg','69.jpg','70.jpg','71.jpg','72.jpg','73.jpg','74.jpg','75.jpg','76.jpg','77.jpg','78.jpg','79.jpg','80.jpg','81.jpg','82.jpg','83.jpg','84.jpg','85.jpg','86.jpg','87.jpg','88.jpg','89.jpg','90.jpg','91.jpg','92.jpg','93.jpg','94.jpg','95.jpg','96.jpg','97.jpg','98.jpg','99.jpg','100.jpg','101.jpg','102.jpg','103.jpg','104.jpg','105.jpg','106.jpg','107.jpg','108.jpg','109.jpg','110.jpg','111.jpg','112.jpg','113.jpg','114.jpg','115.jpg','116.jpg','117.jpg','118.jpg','119.jpg','120.jpg','121.jpg','122.jpg','123.jpg','124.jpg','125.jpg','126.jpg','127.jpg','128.jpg','129.jpg','130.jpg','131.jpg','132.jpg','133.jpg','134.jpg','135.jpg'];
  9. var ImgAry5=['1.jpg','2.jpg','3.jpg','4.jpg','5.jpg','6.jpg','7.jpg','8.jpg','9.jpg','10.jpg','11.jpg','12.jpg','13.jpg','14.jpg','15.jpg','16.jpg','17.jpg','18.jpg','19.jpg','20.jpg','21.jpg','22.jpg','23.jpg','24.jpg','25.jpg','26.jpg','27.jpg','28.jpg','29.jpg','30.jpg','32.jpg','33.jpg','34.jpg','35.jpg','36.jpg','37.jpg','38.jpg','39.jpg','40.jpg','41.jpg','42.jpg','43.jpg','44.jpg','45.jpg','46.jpg','47.jpg','48.jpg','49.jpg','50.jpg','51.jpg','52.jpg','53.jpg','54.jpg','55.jpg','56.jpg','57.jpg','58.jpg','59.jpg','60.jpg','61.jpg','62.jpg','63.jpg','64.jpg','65.jpg','66.jpg','67.jpg','68.jpg','69.jpg','70.jpg','71.jpg','72.jpg','73.jpg','74.jpg','75.jpg','76.jpg','77.jpg','78.jpg','79.jpg','80.jpg','81.jpg','82.jpg','83.jpg','84.jpg','85.jpg','86.jpg','87.jpg','88.jpg','89.jpg','90.jpg','91.jpg','92.jpg','93.jpg','94.jpg','95.jpg','96.jpg','97.jpg','98.jpg','99.jpg','100.jpg','101.jpg','102.jpg','103.jpg','104.jpg','105.jpg','106.jpg','107.jpg','108.jpg','109.jpg','110.jpg','111.jpg','112.jpg','113.jpg','114.jpg','115.jpg','116.jpg','117.jpg','118.jpg','119.jpg','120.jpg','121.jpg','122.jpg','123.jpg','124.jpg','125.jpg','126.jpg','127.jpg','128.jpg','129.jpg','130.jpg','131.jpg','132.jpg','133.jpg','134.jpg','135.jpg'];
  10. var ImgAry6=['1.jpg','2.jpg','3.jpg','4.jpg','5.jpg','6.jpg','7.jpg','8.jpg','9.jpg','10.jpg','11.jpg','12.jpg','13.jpg','14.jpg','15.jpg','16.jpg','17.jpg','18.jpg','19.jpg','20.jpg','21.jpg','22.jpg','23.jpg','24.jpg','25.jpg','26.jpg','27.jpg','28.jpg','29.jpg','30.jpg','32.jpg','33.jpg','34.jpg','35.jpg','36.jpg','37.jpg','38.jpg','39.jpg','40.jpg','41.jpg','42.jpg','43.jpg','44.jpg','45.jpg','46.jpg','47.jpg','48.jpg','49.jpg','50.jpg','51.jpg','52.jpg','53.jpg','54.jpg','55.jpg','56.jpg','57.jpg','58.jpg','59.jpg','60.jpg','61.jpg','62.jpg','63.jpg','64.jpg','65.jpg','66.jpg','67.jpg','68.jpg','69.jpg','70.jpg','71.jpg','72.jpg','73.jpg','74.jpg','75.jpg','76.jpg','77.jpg','78.jpg','79.jpg','80.jpg','81.jpg','82.jpg','83.jpg','84.jpg','85.jpg','86.jpg','87.jpg','88.jpg','89.jpg','90.jpg','91.jpg','92.jpg','93.jpg','94.jpg','95.jpg','96.jpg','97.jpg','98.jpg','99.jpg','100.jpg','101.jpg','102.jpg','103.jpg','104.jpg','105.jpg','106.jpg','107.jpg','108.jpg','109.jpg','110.jpg','111.jpg','112.jpg','113.jpg','114.jpg','115.jpg','116.jpg','117.jpg','118.jpg','119.jpg','120.jpg','121.jpg','122.jpg','123.jpg','124.jpg','125.jpg','126.jpg','127.jpg','128.jpg','129.jpg','130.jpg','131.jpg','132.jpg','133.jpg','134.jpg','135.jpg'];
  11. var ImgAry7=['1.jpg','2.jpg','3.jpg','4.jpg','5.jpg','6.jpg','7.jpg','8.jpg','9.jpg','10.jpg','11.jpg','12.jpg','13.jpg','14.jpg','15.jpg','16.jpg','17.jpg','18.jpg','19.jpg','20.jpg','21.jpg','22.jpg','23.jpg','24.jpg','25.jpg','26.jpg','27.jpg','28.jpg','29.jpg','30.jpg','32.jpg','33.jpg','34.jpg','35.jpg','36.jpg','37.jpg','38.jpg','39.jpg','40.jpg','41.jpg','42.jpg','43.jpg','44.jpg','45.jpg','46.jpg','47.jpg','48.jpg','49.jpg','50.jpg','51.jpg','52.jpg','53.jpg','54.jpg','55.jpg','56.jpg','57.jpg','58.jpg','59.jpg','60.jpg','61.jpg','62.jpg','63.jpg','64.jpg','65.jpg','66.jpg','67.jpg','68.jpg','69.jpg','70.jpg','71.jpg','72.jpg','73.jpg','74.jpg','75.jpg','76.jpg','77.jpg','78.jpg','79.jpg','80.jpg','81.jpg'];
  12.  
  13.  
  14.  
  15. // The SelAry is used to populate the Select Images SelectList
  16. var SelAry=[];
  17. // Each field is an array defining an option
  18. // field 0 = the text to be displayed in the option
  19. // field 1 = the directory path for the images
  20. // field 2 = the image file names]
  21. SelAry[0]=[];
  22. SelAry[1]=['The Pilot Episode','http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/memory/pilot1/',ImgAry];
  23. SelAry[2]=['The Origin Story','http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/memory/tos1/',ImgAry2];
  24. SelAry[3]=['The Culex Experiment','http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/memory/tce1/',ImgAry3];
  25. SelAry[4]=['Monsoon Man','http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/memory/mm1/',ImgAry4];
  26. SelAry[5]=['The Rameses Connection','http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/memory/trc1/',ImgAry5];
  27. SelAry[6]=['The Living Stones','http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/memory/tlstones1/',ImgAry6];
  28. SelAry[7]=['Audio Series','http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/memory/audio1/',ImgAry7];
  29.  
  30.  
  31. var j = 0
  32. var q = ImgAry.length;
  33.  
  34. var preBuffer = new Array()
  35. for (i = 0; i < q; i++){
  36.    preBuffer[i] = new Image()
  37.    preBuffer[i].src = ImgAry[i]
  38. }
  39.  
  40. var whichImage = Math.round(Math.random()*(q-1));
  41. function showImage(){
  42. document.write('<img src="'+ImgAry[whichImage]+'" width=\"640\" height=\"456\">');
  43. }
  44.  
  45.  
  46. //  End -->
  47. </script>
Mar 28 '07 #1
18 1635
iam_clint
1,208 Recognized Expert Top Contributor
I guess i really don't understand your question you showed code whats wrong with the code?
Mar 28 '07 #2
iam_clint
1,208 Recognized Expert Top Contributor
Expand|Select|Wrap|Line Numbers
  1. function showImage(whichstyle){
  2. var style = SelAry[whichstyle];
  3. style = style[1];
  4. document.write('<img src="'+style+ImgAry[whichImage]+'" width=\"640\" height=\"456\">');
  5. }
  6.  
  7. //  End -->
  8. </script>
  9. <input type="button" onclick="showImage(1);" value="click me!">
  10.  
you mean something like this?
Mar 28 '07 #3
tpgames
785 Contributor
I can't get any images to show up. I'm trying to get the code to recognize the array and recognize the image URL. I'm attempting to make it so the JS is on its own page and is called to the html page.

The user would have a menu to select a theme from. I've not put that code in yet, forgot. Babysitting and new to JS = Confusion. LOL Thanks!

The Link to page

This is what I did on another page:
Page 1

The images show up, but don't use an image array I like. I'd rather just use images array whereby I only have to change the link and title to get what I want, which is why I copied code from a memory game.
Mar 28 '07 #4
tpgames
785 Contributor
Better idea: Forget selecting the theme from within the page. Instead, use simple html link to theme instead of selection box that doesn't work.

Use page 1 script. But, alter it to handle Arrays in this format:
Expand|Select|Wrap|Line Numbers
  1. var ImgAry=new Array();
  2. // Each field is an array defining an option
  3. // field 0 = the directory path for the images
  4. // field 1 = the image file names
  5. // field 2 = width and height]
  6. ImgAry[0]=['http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/memory/tlstones1/',ImgAry1, 640,556];
  7. ImgAry[1]=['1.jpg','2.jpg','3.jpg','4.jpg','5.jpg','6.jpg','7.jpg','8.jpg','9.jpg','10.jpg','11.jpg','12.jpg','13.jpg','14.jpg','15.jpg','16.jpg','17.jpg','18.jpg','19.jpg','20.jpg','21.jpg','22.jpg','23.jpg','24.jpg','25.jpg','26.jpg','27.jpg','28.jpg','29.jpg','30.jpg','32.jpg','33.jpg','34.jpg','35.jpg','36.jpg','37.jpg','38.jpg','39.jpg','40.jpg','41.jpg','42.jpg','43.jpg','44.jpg','45.jpg','46.jpg','47.jpg','48.jpg','49.jpg','50.jpg','51.jpg','52.jpg','53.jpg','54.jpg','55.jpg','56.jpg','57.jpg','58.jpg','59.jpg','60.jpg','61.jpg','62.jpg','63.jpg','64.jpg','65.jpg','66.jpg','67.jpg','68.jpg','69.jpg','70.jpg','71.jpg','72.jpg','73.jpg','74.jpg','75.jpg','76.jpg','77.jpg','78.jpg','79.jpg','80.jpg','81.jpg','82.jpg','83.jpg','84.jpg','85.jpg','86.jpg','87.jpg','88.jpg','89.jpg','90.jpg','91.jpg','92.jpg','93.jpg','94.jpg','95.jpg','96.jpg','97.jpg','98.jpg','99.jpg','100.jpg','101.jpg','102.jpg','103.jpg','104.jpg','105.jpg','106.jpg','107.jpg','108.jpg','109.jpg','110.jpg','111.jpg','112.jpg','113.jpg','114.jpg','115.jpg','116.jpg','117.jpg','118.jpg','119.jpg','120.jpg','121.jpg','122.jpg','123.jpg','124.jpg','125.jpg','126.jpg','127.jpg','128.jpg','129.jpg','130.jpg','131.jpg','132.jpg','133.jpg','134.jpg','135.jpg'];
  8.  
How do I do this? I'd like it to randomly choose an image in the folder. The above code does NOT work!
Currently, I get the error
http://www.tpgames.net/gaming/2/word/cipher/f/undefined

Current Page 1
Thanks!
Mar 29 '07 #5
tpgames
785 Contributor
NEW CODE:

Expand|Select|Wrap|Line Numbers
  1. var theTPImg = new Array();
  2. ImgUrl[0]=['http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/memory/tlstones1/'];
  3. theTPImg[1]=['1.jpg','2.jpg','3.jpg','4.jpg','5.jpg','6.jpg','7.jpg','8.jpg','9.jpg','10.jpg','11.jpg','12.jpg','13.jpg','14.jpg','15.jpg','16.jpg','17.jpg','18.jpg','19.jpg','20.jpg','21.jpg','22.jpg','23.jpg','24.jpg','25.jpg','26.jpg','27.jpg','28.jpg','29.jpg','30.jpg','32.jpg','33.jpg','34.jpg','35.jpg','36.jpg','37.jpg','38.jpg','39.jpg','40.jpg','41.jpg','42.jpg','43.jpg','44.jpg','45.jpg','46.jpg','47.jpg','48.jpg','49.jpg','50.jpg','51.jpg','52.jpg','53.jpg','54.jpg','55.jpg','56.jpg','57.jpg','58.jpg','59.jpg','60.jpg','61.jpg','62.jpg','63.jpg','64.jpg','65.jpg','66.jpg','67.jpg','68.jpg','69.jpg','70.jpg','71.jpg','72.jpg','73.jpg','74.jpg','75.jpg','76.jpg','77.jpg','78.jpg','79.jpg','80.jpg','81.jpg','82.jpg','83.jpg','84.jpg','85.jpg','86.jpg','87.jpg','88.jpg','89.jpg','90.jpg','91.jpg','92.jpg','93.jpg','94.jpg','95.jpg','96.jpg','97.jpg','98.jpg','99.jpg','100.jpg','101.jpg','102.jpg','103.jpg','104.jpg','105.jpg','106.jpg','107.jpg','108.jpg','109.jpg','110.jpg','111.jpg','112.jpg','113.jpg','114.jpg','115.jpg','116.jpg','117.jpg','118.jpg','119.jpg','120.jpg','121.jpg','122.jpg','123.jpg','124.jpg','125.jpg','126.jpg','127.jpg','128.jpg','129.jpg','130.jpg','131.jpg','132.jpg','133.jpg','134.jpg','135.jpg'];
  4.  
  5. var newBanner = 0;
  6. var totalBan = theTPImg.length;
  7.  
  8. function cycleBan() {
  9.   newBanner++;
  10.   if (newBanner == totalBan) {
  11.     newBanner = 0;
  12.   }
  13.   document.banner.src= "'+ImgUrl+' 'theTPImg[newBanner]'";
  14.   // set the time below for length of image display
  15.   // i.e., "4*1000" is 4 seconds
  16.   setTimeout("cycleBan()", 4*1000);
  17. }
  18. window.onload=cycleBan;
  19.  
  20.  

Found here

The issue: It says the url is wrong. Actually, I probably have
this code wrong:
Expand|Select|Wrap|Line Numbers
  1.   document.banner.src= "'+ImgUrl+' 'theTPImg[newBanner]'";
Its not recognizing the url variable. How should this code be written? Thanks!

This code would have the array I want.
Mar 29 '07 #6
tpgames
785 Contributor
CORRECTION:
The issue: Not changing the images at all. Only displays 1.jpg
This code is probably wrong, but don't know how to fix it.
Expand|Select|Wrap|Line Numbers
  1.   document.banner.src= "'+ImgUrl+' 'theTPImg[newBanner]'";
Its not recognizing the url variable. How should this code be written? Thanks!

This code would have the array I want.
(try editing, got the edit box but then it timed out and gave me the can not edit page! Foolish program. Should not time out within 30 seconds of saying I'm within the time limit!)
Mar 29 '07 #7
Romulo NF
54 New Member
ok.. lets forget about what you already have!
i tried to look at your code and im even more confused now :P

can you try to explain exactly what you want to do?
Mar 29 '07 #8
tpgames
785 Contributor
Clarification:
I'm trying to avoid having to add the URL of the image to every single image in the array and avoid making the image array
[html]
http://www.url.com/name1.jpg., http://www.url.com/name2.jpg, ect. for all 135 images.
[/html]
(Just in case it tried treating it as html anyhow, I added tags.)
Mar 29 '07 #9
tpgames
785 Contributor
This uses the original variable names with bannerImg.
The // indicates the original scripts array, with the images in the same folder as the script. My images are hosted at photob...dotCom , instead of at my site. I'm attempting to use an array to define the URL where the images are located, and a Array of the image names. I'm also attempting to have the code recognize the url of the images and attach it to the image names and display this image. Currently, the images will rotate like in a banner.

Expand|Select|Wrap|Line Numbers
  1. var bannerImg = new Array();
  2.   // Enter the names of the images below
  3.  // bannerImg[0]="image_jss.gif";
  4.  // bannerImg[1]="image_js.gif";
  5.  // bannerImg[2]="image_wr.gif";
  6.  
  7.  
  8. ImgUrl[0]=['http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/memory/tlstones1/'];
  9. bannerImg[1]=['1.jpg','2.jpg','3.jpg','4.jpg','5.jpg','6.jpg','7.jpg','8.jpg','9.jpg','10.jpg','11.jpg','12.jpg','13.jpg','14.jpg','15.jpg','16.jpg','17.jpg','18.jpg','19.jpg','20.jpg','21.jpg','22.jpg','23.jpg','24.jpg','25.jpg','26.jpg','27.jpg','28.jpg','29.jpg','30.jpg','32.jpg','33.jpg','34.jpg','35.jpg','36.jpg','37.jpg','38.jpg','39.jpg','40.jpg','41.jpg','42.jpg','43.jpg','44.jpg','45.jpg','46.jpg','47.jpg','48.jpg','49.jpg','50.jpg','51.jpg','52.jpg','53.jpg','54.jpg','55.jpg','56.jpg','57.jpg','58.jpg','59.jpg','60.jpg','61.jpg','62.jpg','63.jpg','64.jpg','65.jpg','66.jpg','67.jpg','68.jpg','69.jpg','70.jpg','71.jpg','72.jpg','73.jpg','74.jpg','75.jpg','76.jpg','77.jpg','78.jpg','79.jpg','80.jpg','81.jpg','82.jpg','83.jpg','84.jpg','85.jpg','86.jpg','87.jpg','88.jpg','89.jpg','90.jpg','91.jpg','92.jpg','93.jpg','94.jpg','95.jpg','96.jpg','97.jpg','98.jpg','99.jpg','100.jpg','101.jpg','102.jpg','103.jpg','104.jpg','105.jpg','106.jpg','107.jpg','108.jpg','109.jpg','110.jpg','111.jpg','112.jpg','113.jpg','114.jpg','115.jpg','116.jpg','117.jpg','118.jpg','119.jpg','120.jpg','121.jpg','122.jpg','123.jpg','124.jpg','125.jpg','126.jpg','127.jpg','128.jpg','129.jpg','130.jpg','131.jpg','132.jpg','133.jpg','134.jpg','135.jpg'];
  10.  
  11. //The rest of the original code is below.
  12.  
  13. var newBanner = 0;
  14. var totalBan = bannerImg.length;
  15.  
  16. function cycleBan() {
  17.   newBanner++;
  18.   if (newBanner == totalBan) {
  19.     newBanner = 0;
  20.   }
  21.   document.banner.src=bannerImg[newBanner];
  22.   // set the time below for length of image display
  23.   // i.e., "4*1000" is 4 seconds
  24.   setTimeout("cycleBan()", 4*1000);
  25. }
  26. window.onload=cycleBan;
What I tried to do in my code was get ImgUrl and bannerImg to work together to display an image. My code was wrong, and don't know how it should be written. Here, I left my code out as it was all wrong.
Thanks!
Mar 29 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

8
3043
by: Paul Cochrane | last post by:
Hi all, I've got an application that I'm writing that autogenerates python code which I then execute with exec(). I know that this is not the best way to run things, and I'm not 100% sure as to what I really should do. I've had a look through Programming Python and the Python Cookbook, which have given me ideas, but nothing has gelled yet, so I thought I'd put the question to the community. But first, let me be a little more detailed...
4
1664
by: A Traveler | last post by:
Given i have some control which has an "ImageURL" property. If this property is set, then the HTML code for the web control looks something like: <mns:image id=MyImg runat=server ImageURL="images/somepath.jpg"></mns:image> Given i have some server variable Session("AppRoot") which declares the full path to the root of the application, for example Session("AppRoot") = "http://www.someserver.com/myapp/" Now is there any way i can put...
2
1167
by: mark | last post by:
I put this question on a new thread because, in spirit, it is a new question. I apologize that I have difficulty formulating the proper question. My application performs matrix computations on data stored in arrays A, B, …G. Populate subs fill a datagrid on instances of form2 with the elements of the arrays (one form2 instance per array) so that the user can see what is in the arrays. The caption of the form2 instances displays what...
1
3243
by: Xah Lee | last post by:
The following is a program to generate thumbnail images for a website. Useful, if you want to do that. It is used to generate the thumbnails for my “Banners, Damsels, and Mores” project gallery. ( http://xahlee.org/Periodic_dosage_dir/lanci/lanci.html ) Comments and versions in other lang welcome. Xah
8
1526
by: GabrielESandoval | last post by:
i currently use the code below to create a slideshow of images. i edited it so that its not as long. i currently have over 20 images i want to change it so that the images dont appear in the same order each time. what would i have to change to make the cycle random??? thanks in advance for the help. gabriel -- heres the code --
1
2044
by: laurakr | last post by:
I am trying to use a clear to get my bottom nav bar below the quote box on the right, but it isn't working. I would like the bottom edge of the quote box to "stick" to the footer nav bar but copy to be able to flow to the left of the quote box. For the bonus round I would like the right edge of the box to align with the right edge of the footer Could someone take a look at my code and help a newbie troubleshoot? my email is lroeder at...
2
5091
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer must be embedded somewhere in the source code, and I would like to know if anyone knows where to find the correct answer. I would greatly appreciate it!! Thanks!! <!--put the preloads file here as it must load before the website class...
4
68283
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer must be embedded somewhere in the source code, and I would like to know if anyone knows where to find the correct answer. I would greatly appreciate it!! Thanks!!
16
2596
by: haft | last post by:
I have posted this question on a javascript forum as it contains javascript code however it was believed to be an asp issue. The following head section javascript code contains the function showBigImage( isource,bigImage,header ) function call of discussion: var currentImage; function showBigImage( isource,bigImage,header ) { var theImage = document.getElementById( 'largeimage' ); theImage.src = isource;
0
9597
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10369
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10110
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9187
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5682
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3851
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.