jQuery navigation bar
Yes,

you could for starters derive the child position once with 

var index =  $('div.nav ul li').index( this )


Then you could adapt to index 0 and 1 in 1 if statement
Finally, you could just derive the index and have the animate statement only once.

Something like this in the end might do:

$('div.nav ul li').on('click', function() {

    var index = $('div.nav ul li').index( this ), top;

    if( index &lt; 2 ){
      top = '0';
    }
    if( index == 2 ){
      top = $('div.features').offset().top + 'px';  
    }
    if( index == 3 ){
      top = $(document).height() + 'px';  
    }
   if(top){
        $("html, body").animate({
            scrollTop: "0"
        }, 'slow');
   }
});