使用CSS3或jQuery的背景图片动画? [英] Background image animation using css3 or jquery?

查看:139
本文介绍了使用CSS3或jQuery的背景图片动画?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助我如何为该网站上的背景图片制作动画

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

http://breakpoint-sass.com/

在积分部分,背景图像似乎在移动,我不知道它是使用css3还是jquery.

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.

非常感谢.

推荐答案

只是一个动画BG精灵图片的简单演示

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);

信息:如果您想要24fps的速率,即〜42(41.666ms)

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

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

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

这篇关于使用CSS3或jQuery的背景图片动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆