Auto-highlight menu item when scrolling through API doc

http://htmlpreview.github.io/?https://github.com/cesanta/fossa/blob/doc_menu/docs/index.html
Added, to be committed with scrolling CL

On Fri, Nov 14, 2014 at 5:58 PM, Marko Mikulicic <notifications@github.com>
wrote:

> In docs/doc.js:
>
> > +    // Get container scroll position
> > +   var fromTop = $(this).scrollTop() + 40;
> > +
> > +   // Get id of current scroll item
> > +   var cur = scrollItems.map(function(){
> > +     if ($(this).offset().top < fromTop)
> > +       return this;
> > +   });
> > +   // Get the id of the current element
> > +   cur = cur[cur.length-1];
> > +   var id = cur && cur.length ? cur[0].id : "";
> > +   menuItems
> > +     .parent().removeClass(className)
> > +     .end().filter("[href=#"+id+"]").parent().addClass(className);
> > + });
> > +});
>
> No newline at the end of the file
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/cesanta/fossa/pull/81/files#r20374497>.
>