jquery-endless-scroll
jquery-endless-scroll copied to clipboard
Infinite scroll up/down parameterization
I have came up with an idea of parameterization of the scrolling functionality.
- add scrollMode to options. It should be set to one of the following:
- "next" -- detect only downwards scrolling;
- "prev" -- detect only upwards scrolling;
- null -- detect both downwards and upwards scrolling;
- change logic of the detectScrollDirection function:
- remove
javascript this.didScroll = true;
before the if-block; - add
javascript this.didScroll = this.options.scrollMode ? this.options.scrollMode === this.scrollDirection : true;
after if-block;
- remove
This will set didScroll to false in case of unneeded scroll event
+1
Is this functionality appears ?
This was an awesome functionality from you @digreamon . Well done :)