типа такого?
<html>
<head>
<title>Тестирование</title>
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
</head>
<body>
<a href="#content1" onclick="link(this);">link 1</a>
<a href="#content2" onclick="link(this);">link 2</a>
<div class="content">
<div class="content1" style="display: block;">1111111</div>
<div class="content2" style="display: none;">222222222</div>
</div>
<script>
var prev = $('.content1');
function link (ths) {
var href = ths.getAttribute('href'),
cl = href.split('#')[1],
obj = $('.' + cl);
prev.css('display', 'none');
obj.css('display', 'block');
prev = obj;
}
</script>
</body>
</html>