问题描述
限时送ChatGPT账号..我玩过 youtube 的精灵动画,但有问题.backgroundPositionX
不能在 Firefox 下工作(但可以在 Chrome 和 IE8 上工作)...这是代码:https://jsfiddle/74RZb/
I have play with youtube's sprite animation but there is a problem. backgroundPositionX
won't work under Firefox (but works on Chrome and IE8)...
This is the code: https://jsfiddle/74RZb/
额外信息:问题是在firefox下它不会改变背景位置(不会播放动画)......没有错误,只是不会改变背景位置.
Extra info: the problem is that under firefox It doesn't change the background position (won't play the animation)... there are no errors, just doesn't change the background position.
推荐答案
Firefox 不支持 backgroundPositionX,但支持 背景位置
Firefox doesn't support backgroundPositionX, but it does support background position
所以我们可以这样做:
psy.style.backgroundPosition = x+'px 0';
这会设置背景位置,先是 X,然后是 Y.
This sets the background position, X first, then Y.
工作示例这里
这篇关于backgroundPositionX 不适用于 Firefox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论