How to do background-position-x in Jquery ?
console.log($('.element').css('background-position-x'));
Outputs (an empty string)
console.log($('.element').css('background-position'));
Outputs 0px 0px
What I want to do is:
$(this).css('background-position-x', '-162px');
How to make it work ?
Thank you very much.
background-position-xis not standard css and is not supoprted in all browsers. Take a look at solution at Background Position animation in jQuery not working in Firefox.