Random file



  • I have a way to the folder. There's pictures in the file. How do I get an early picture and use it?



  • var images = new Array('pic1.jpg','pic2.jpg','pic3.png');
    var rand_file_index = Math.round(Math.rand()*(images.length-1));
    rand_file_name = images[rand_file_index];//Далее его можно вставить, например, в SRC
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2