0

I need to upgrade from jQuery 1.7 to jQuery 1.8, but the backgroundPosition animation is failing after the upgrade. There are no error messages in the Firebug console at all. Has anyone else had experience with the backgroundPosition animation failing from 1.7 to 1.8?

jQuery(navSelector).hover(function(){                   
      jQuery(this).find('a').stop().animate({"backgroundPosition":"(0 -40px)"},{duration:150});         
    },
    function(){             
      jQuery(this).find('a').stop().animate({backgroundPosition:"(0 0)"}, {duration:75});   
    });
});
Nelson
  • 1,719
  • 3
  • 16
  • 26
  • Can you animate the x and y values separately? – Blazemonger Aug 28 '12 at 19:18
  • This should have never worked at all. Anyway, just answered [THIS](http://stackoverflow.com/questions/12160846/jquery-background-position-doesnt-work-in-firefox/12161533#12161533)... – adeneo Aug 28 '12 at 19:19
  • I should mention that, from what I understand, jQueryUI is actually responsible for this ever working in the first place. There appears to be some discrepancy between jQuery 1.8 and jQueryUI 1.8 that didn't exist between jQuery 1.7 and jQueryUI 1.8. I have tried JQUI 1.8.11 and 1.8.23 with no luck. Likewise, I cannot animate each value separately. – Nelson Aug 28 '12 at 19:39

3 Answers3

1

animate backgroundPosition has been broken since 1.5 - apparently it was never supposed to be in any of the releases

Andy
  • 11
  • 1
0

The 1.8 version had many bugs, especially in IE9 & IE10. Download 1.8.1 and you should be good. Here's the changes: http://blog.jquery.com/2012/08/30/jquery-1-8-1-released/

adamdehaven
  • 5,890
  • 10
  • 61
  • 84
0

It's not broken.. it works differently now

$arrow.animate({'background-position-x': '0px', 'background-position-y': '0px' }, 300);
Ben
  • 51,770
  • 36
  • 127
  • 149
chemic
  • 1