Я нашел этот маленький фрагмент кода, который соответствует моим потребностям, но есть ли способ сделать «цель 1» загружен по умолчанию? Так что «право» не начинается как пустой div, но с контентом от «target 1» уже.Горизонтальный div, скользящий с jQuery
jQuery(function($) {
$('a.panel').click(function() {
var $target = $($(this).attr('href')),
$other = $target.siblings('.active');
if (!$target.hasClass('active')) {
$other.each(function(index, self) {
var $this = $(this);
$this.removeClass('active').animate({
left: $this.width()
}, 500);
});
$target.addClass('active').show().css({
left: -($target.width())
}).animate({
left: 0
}, 500);
}
});
});
http://jsfiddle.net/sg3s/rs2QK/