$("a").hover(function(){
$(this).animate({
'padding-left': '+=10px'
}, "normal");
}, function(){
$(this).animate({
'padding-left': '-=10px'
}, "normal");
});
I have the above piece of code, which would normally animate the padding of an "a" tag on hover. This works fine in Chrome, but not on Firefox nor IE. At first, I thought it could be because of my CSS or something, so I added CSS to add the padding on hover, and it worked. It's only the jQuery animation that isn't working. So I'm at a loss as to what it might be. Any ideas? Thanks in advance.
Changing 'padding-left' to paddingLeft worked, for some strange reason. I thought about it after seeing backgroundColor in another piece of javascript.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With