I am trying to bind a handler to an event. The event is a keydown function. The handler will listen for hit variables to produce one of two conditions. The 1st condition (odd number of hits) will perform 1 function, the 2nd (even number of hits) will perform another function. To elaborate, the 1st function will scroll to one element, the 2nd will scroll to another element
FIDDLE
Above is a link to a demo, there is a nasty bug which you can see.
The only thing I can think of is that the following should be revised for the second event:
.offset().top