Background image animation using css3 or jquery?

can someone help me on how to animate the background image, for example on this website.

http://breakpoint-sass.com/

in the credits section, the background image seems to be moving, I don't know if it is using css3 or jquery.

And is there any tutorial on how to do this or using a plugin.

Many thanks.

+3


source to share


1 answer


Just a simple BG sprite image animation demo

http://jsbin.com/ohulok/1/edit

var c = 0 ;
function loop(){
  c = ++c%5;
  $('#bird').css({backgroundPosition: (240*c)+'px 0px'});
}
setInterval(loop, 42);

      



Info: if you want 24fps speed that's ~ 42 (41.666ms)

http://jsbin.com/ohulok/7/edit

+3


source







All Articles