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.net/74RZb/
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.
You can do something like this
First install jquery migration
https://github.com/jquery/jquery-migrate/#readme
Include these on your html
The $.browser property allows you to target browsers you want to apply your style into
In this case for background-position can be changed to property supported backgroundPosition
Available flags are - webkit - safari - opera - msie (for IE) - mozilla
Example for IE or Firefox
for chrome
I got mine working and for all IE
Cheers
This works in IE, FF and chrome:
background-position: 0 center;
This worked for me.
NX
is number of pixels in axis X andNY
in axis Y.Background position-x can work in firefox you just have to specify a fixed background-y position. Here is a function I wrote to move a ribbon from left to right. At first it did not work when there was just a position-x specification, well it worked in IE but not FF. This was my solution. It is the actual code with comments from my site that works in both IE and FF:
Using like this:
Firefox doesn't support backgroundPositionX, but it does support background position
So we can do something like this:
This sets the background position, X first, then Y.
Working example here