Posted By

virgil on 03/15/11


Tagged


Versions (?)

CSS Background position parse


 / Published in: jQuery
 

  1. function getBackgroundPositionX(value){
  2.  
  3. if(!$(value).css('backgroundPosition')) {
  4. //ie fix
  5. backPos = $(value).css('background-position-x');
  6. posX = Number(backPos.split("px")[0]);
  7. } else {
  8. backPos = $(value).css('backgroundPosition').split(" ");
  9. posX = Number(backPos[0].split("px")[0]);
  10. }
  11.  
  12. return posX;
  13. }

Report this snippet  

You need to login to post a comment.