jQuery的动画以块的形式背景的位置? [英] jQuery animate background position in chunks?

查看:177
本文介绍了jQuery的动画以块的形式背景的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用jQuery,使我跨度的背景位置走下来10像素每秒。什么是做到这一点的好办法?

I'm trying to use jQuery to make a background position of my span go down 10 pixels every second. What is a good way to do this?

我一直在玩jQuery的动画,延迟,CSS,有的的setTimeout 功能,但我不能得到任何工作。建议大大appriciated!

I've been playing with jQuery animate, delay, CSS, and some setTimeout functions but I can't get anything to work. Suggestions greatly appriciated!

我试图让我的Y位置从0到100的10个像素为增量,然后停止动画。

I'm trying to make my y-position go from 0 to 100 in increments of 10 pixels, and then stop the animation.

推荐答案

jQuery的不能正确的动画效果,因为需要动画两个值,而不只是一个背景的位置。说明和解决方案在这里:

jQuery can't animate background position properly because of the need to animate two values instead of just one. Explanation and solution here:

http://snook.ca/archives/javascript/jquery-bg - 图像 - 动画/

这篇关于jQuery的动画以块的形式背景的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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