Villan
Villan

Reputation: 730

Preload a spritesheet using Jquery

I am having a spritesheet now what i want to do is to preload the spritesheet images how can i get through it using javascript.Please help me out.

Upvotes: 0

Views: 444

Answers (1)

Torsten Walter
Torsten Walter

Reputation: 5782

This is not HTML5 nor specifically jQuery related. A sprite sheet is just an image, so preload like you would any other image. That said, a "jQuery way" would be:

var $mySprite = $("<img>").attr("src", "myURL");

Voila.

Upvotes: 1

Related Questions