Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background image animation using css3 or jquery? [closed]

can anyone help me about how to animate a background image like on this website

http://breakpoint-sass.com/

on the credits section the background image seems moving, i don't know if it is using css3 or jquery.

And is there any tutorial on how to do it or via using plugin.

Many thanks.

like image 448
user2074113 Avatar asked Dec 05 '25 08:12

user2074113


1 Answers

Just a simple demo of animating a BG sprite image

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 a 24fps rate that's ~42 (41.666ms)

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

like image 75
Roko C. Buljan Avatar answered Dec 07 '25 23:12

Roko C. Buljan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!