No, you are on the right track.
Assuming you have links like these
<ul id="menu">
<li><a href="2010.php">2010</a></li>
<li><a href="2009.php">2009</a></li>
<li><a href="2008.php">2008</a></li>
</ul>
And the contents of the div
<div id="content"></div>
You just need to write a simple jQuery function.
$("#ul#menu li a").click(function(e) {
e.preventDefault();
var $parent = $(this).parent();
$parent.addClass("selected").siblings().removeClass("selected");
var href = $(this).attr('href');
$("#content").load(href + " #content", function() {
});
});
source
share