JSFiddle - React, Tailwind, and code Playground
HTML
<div id="background"></div>
CSS
#background {background: url(http://www.dreamincode.net/forums/uploads/monthly_05_2010/post-380028-12747928967239.jpg); height: 100%; width: 100%; position: absolute;}
JavaScript
$.fn.animateBG = function(x, y, speed) {
var pos = this.css('background-position').split(' ');
this.x = pos[0] || 0,
this.y = pos[1] || 0;
$.Animation( this, {
x: x,
y: y
}, {
duration: speed
}).progress(function(e) {
this.css('background-position', e.tweens[0].now+'px '+e.tweens[1].now+'px');
});
return this;
}
$("#background").animateBG(-1020, 500, 1200);