Because of this line of code,
var $marginLefty = $(this).next();
the next li element after what was clicked on is animated since you later do $marginLefty.animate(). If you want to animate the div, you should set marginLefty to the div element. So replace that line with:
var $marginLefty = $('.inner');
To find out which li was clicked, you can do
// $(this) refers to the element that was clicked
$liClass = $(this).attr("class")
inside the click handler. Then you can change the content of the div based which li was clicked, and by using the html() function. For example,
var content;
if($liClass == 'about'){
content = 'about clicked';
}
else if($liClass == 'search'){
content = 'search clicked';
}
//more code here
//more code here
$marginLefty.html(content);
You can find more information about .attr() and .html() over here: http://api.jquery.com/attr/ and http://api.jquery.com/html/