1 Replies - 1178 Views - Last Post: 18 September 2011 - 01:22 PM

#1 Moshambi  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 280
  • Joined: 20-November 07

Javascript Precache Images

Posted 07 January 2010 - 11:28 PM

Description: The design of this snippet is assuming the images are in numbered order (0.jpg, 1.jpg, 2.jpg, 3.jpg ... etc)Precaches images into the browser for quick use later on.
function preCash()
{	
	var imageArray = new Array();
		
	var i = 0;
	for(i = 0; i < document.images.length; i++)
	{
		imageArray[i] = new Image();
		imageArray[i].src = "images/" + i + ".jpg";
	}
}

Is This A Good Question/Topic? 0
  • +

Replies To: Javascript Precache Images

#2 RetardedGenius  Icon User is offline

  • >>──(Knee)──►
  • member icon

Reputation: 127
  • View blog
  • Posts: 555
  • Joined: 30-October 10

Re: Javascript Precache Images

Posted 18 September 2011 - 01:22 PM

What the fuck is that even doing?!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1