Friday, January 06, 2012

JavaScript Sprite Animation Using jQuery » SitePoint

JavaScript Sprite Animation Using jQuery » SitePoint: "2) Setting up some useful variables

We have a handful of numbers that we’ll need to use several times, so it makes sense to store them in variables. That means we’ll only need to update our script in two places if we decide to change our page size later. The variable names do a fairly good job of describing what they are:

view plainprint?
/* Page sizes*/  
var $pageheight = 189; // our page height  
var $pagewidth = 146; // our page width  
var $pageYpos = 0;  // current Y position of our bg-image  "

'via Blog this'