Is it truly necessary to use margin for positioning elements to the left? If hiding them works just as well for your needs, you can achieve the desired effect with the following simple code:
$(document).ready(function() {
$('#container').css({position:'relative'});
$("#container div:not(:first)").hide();
$('.div1').addClass('current');
$("nav a").click(function() {
var cls = this.name;
$('.current').removeClass('current').animate( { width: "hide", paddingLeft: "hide", paddingRight: "hide", marginLeft: "hide", marginRight: "hide" }, 500, function() {
$('.'+cls).addClass('current').animate( { width: "show", paddingLeft: "show", paddingRight: "show", marginLeft: "show", marginRight: "show" }, 500);
});
return false;
});
});
You can also access this version on your Fiddle link: http://jsfiddle.net/fE8ks/1/