I am attempting to make the margins on an image both auto. I am doing this by:
$('#headerImg').delay(100).animate({
"margin-left": "auto",
"margin-right": "auto"
}, 650, function() {
//not important
});
but it does not work. It does however work if I do:
$('#headerImg').css({"margin-left":"auto","margin-right":"auto"});
My question is, why is it not working? Is there any possible way to get it to work correctly again or would I need to come up with a hacky solution to solve this problem?
Any help is greatly appreciated.