d4nyll / smartscroll

jQuery plugin for scrolljacking and auto-hashing
https://d4nyll.github.io/smartscroll/
MIT License
257 stars 45 forks source link

scrollEnd Event returns no slidenumber #24

Closed DotCoyote closed 6 years ago

DotCoyote commented 8 years ago

Hi,

in your documentation, you write

The scrollStart and scrollEnd listener will receive the slide number as its only argument; [...]

which would be very useful for me ;) Unfortunately, your version doesn't return a slidenumber at scrollEnd, but "undefined"

I fixed that in a local copy:

smartscroll.js:174

windowTop = getWindowTop();
if (options.eventEmitter) {
  sectionIndexAtWindowMiddle = getSectionIndexAt(windowTop + $(window).height() / 2);
  options.eventEmitter.emitEvent('scrollEnd', [sectionIndexAtWindowMiddle]);
}
d4nyll commented 8 years ago

@CinKon it must have slipped my mind! Thanks for pointing it out! I hope to go through all the bugs in the issue tracker soon and update them all in one go.

jmcguerreiro commented 8 years ago

Just ran across this today, thanks for the fix @CinKon

d4nyll commented 6 years ago

Fixed in Release 2.5.3. Thank you @CinKon!