Why is adding 'margin: 0 auto' to a slider menu breaks it?
When you center #content
you have to take into account additional offset when doing animation. Hard to explain, take a look at this updated fiddle:
http://jsfiddle.net/jwsh7/1/
var fix = ($(document).width() - $('#content').width()) * .5; // <-- need to subtract this
$(".menu").click(function () {
var middleSlider = ($(".slider").width() - $("#option1").width()) * 0.5;
$(".slider").animate({
left: ($(this).offset().left - middleSlider - fix)
});
});