• 0

Moving background image with jQuery in FireFox


Question

Using jQuery, I'm moving the background image of an HTML element when a certain event occurs. The sample code below works perfectly in IE and Chrome. However, FireFox is being a pain.



$("#someItem").stop().animate({"background-position-x":"100px"}, "easeOutQuart");
[/CODE]

I'd hard to find info on this but on a friend told me that FF doesn't support "[b][i]background-position-x[/i][/b]"

Is this true? If so, how else can I move the background image horizontally in FF?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

background-position is more supported so something like this:

$("#someItem").stop().animate({"background-position":"x y"}, "easeOutQuart");[/CODE]

make sure to add IE9.js before jquery and this code to get support on IE8 and lower ;)

Link to comment
Share on other sites

This topic is now closed to further replies.