user1040899 user1040899 - 16 days ago 8
jQuery Question

jquery background-position-x issue

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.

Answer

background-position-x is 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.

Comments