Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery - Animate css background-size?

I'm trying to animate the size of my background image, but it's not working - Any idea why from the following code?

$(this).animate({'opacity' : 1, 'background-size':'70px 48px', 'right':39, 'top':45}, 250);

Note: all the other properties animate correctly, it's just the background-size that doesn't update.

Thanks!

like image 610
Probocop Avatar asked Oct 10 '22 02:10

Probocop


1 Answers

Because background-size is a CSS3 property that is not supported by jQuery yet as it's still a candidate for recommendation.

See this plugin.

like image 86
thwd Avatar answered Oct 15 '22 14:10

thwd