The bug seems to be caused by the fact that code inside show() is triggering a scrollstart event while still in the midst of handling the scrollstop event. This threw off the setting of showAfterScroll causing the currentstate to be stuck at "inline", so no hide/show code is ever triggered after that.
- Modified the scrollstart and sccrollstop callbacks to set showAfterScroll prior to calling show()/hide().
- movied the hide() call in scrollstart handler underneath the check for 'overlay'.