/**
* @author: Caden
* @Date: 11/6 0006 14:13
*/
$(function () {
$("#detail div").html($("#categories ul li:eq(0) span").html());
$("aside#categories ul li").bind("click", function () {
$("aside#categories ul li span").removeClass("current");
$(this).children("span").addClass("current");
// 注意下面这一行,因为左边每一行的高度是固定的(47px),所以你懂了吧
$(this).parents("#categories").animate({"scrollTop": $(this).index() * 47}, 400);
$("#contents").animate({"scrollTop": 0}, 0);
$("#detail div").html($(this).find("span").html());
});
});