r/javascript • • Jan 25 '19

solved! How could I implement this?

652 Upvotes

57 comments sorted by

View all comments

1

u/damnloveless Jan 25 '19

Desktop developer, but could you get position of cursor when button is clicked and do some math to determine direction of "swipe" ?

1

u/Pixel_Err0r Jan 25 '19

Good idea, but how could I determine which is the current title? Or at least make them snap?

2

u/damnloveless Jan 25 '19

What type of data structure are these stored in now? Say it was something like an array you could increment the index or decrease to keep track of which title is displaying. Sorry I thought you just meant the UI bit initially. Does this help?