lukesnowden / FSVS

Full Screen Vertical Scroll
https://www.lukesnowden.co.uk/full-screen-vertical-scroll/
722 stars 145 forks source link

Slide Up/Down Event? #17

Closed bradleybell closed 9 years ago

bradleybell commented 9 years ago

Hi,

Is it possible to know the direction the user is sliding? i.e. If they go up an event happens and vice versa for down.

Or alternatively, is there a way of custom pagination? I basically want to use text headlines to achieve something similar to this: http://jsfiddle.net/peterhay/xrqjaxk7/

Thanks

lukesnowden commented 9 years ago

Im not sure what you after but this will determine direction: https://jsfiddle.net/bx90Ljuw/ and overwrite the pagination method and rebind it: https://jsfiddle.net/4Lqx76au/1/

hope this helps

bradleybell commented 9 years ago

Thats perfect, thanks so much!

lukesnowden commented 9 years ago

No worries, it's what I'm here for!

bradleybell commented 9 years ago

Sorry one last question.. On the custom pagination, is there any way of adding an 'active' class? Thank you!

lukesnowden commented 9 years ago

Sorry for asking but do u know much is/query? Take a look at the exact function in the fsvs.js. If you can't figure it let me know and I'll sort a demo out for you

lukesnowden commented 9 years ago

(Not at my Mac at the minute)

bradleybell commented 9 years ago

My js knowledge is quite bad.. I'm looking at the exact function in bundle.js so I'll try and work it out! Thanks again.

lukesnowden commented 9 years ago

I'll post u something late when I'm in

bradleybell commented 9 years ago

Got it! - https://jsfiddle.net/4Lqx76au/2/

Thank you :)

lukesnowden commented 9 years ago

boom! no worries

bradleybell commented 9 years ago

Hi Again, sorry to come back at you but I think I celebrated too early! Basically I have the classes working when the pagination is clicked, but not added each time we scroll down as I get this reference error - [Error] ReferenceError: Can't find variable: currentSlideIndex (anonymous function) (show, line 54)

Which makes sense.. I just can't think of a solution round it. Any thoughts? https://jsfiddle.net/4Lqx76au/6/

Thanks again

bradleybell commented 9 years ago

Got it! https://jsfiddle.net/4Lqx76au/7/

Added variable and inserted the active class on callback.