Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  14] [ 7]  / answers: 1 / hits: 16972  / 13 Years ago, thu, march 1, 2012, 12:00:00

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.


More From » jquery

 Answers
26

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.


[#87124] Wednesday, February 29, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kamryn

Total Points: 645
Total Questions: 100
Total Answers: 118

Location: Tanzania
Member since Wed, Feb 24, 2021
3 Years ago
;