ftlabs / ftscroller

FTScroller is a cross-browser Javascript/CSS library to allow touch, mouse or scrollwheel scrolling within specified elements, with pagination, snapping and bouncing support.
MIT License
1.19k stars 121 forks source link

using ftscroller to build a carousel #48

Closed 0xgeert closed 11 years ago

0xgeert commented 11 years ago

Sorry for posting an issue what is actually a mere question:

Am I correct in thinking FTScroller would be great to build a carousel on top of?

Horiziontal scrolling would work on touch devices with swiping (with snap-to-grid or whatever it's called enabled, so only 1 element per swipe is moved) while it needs to fallback to clicks on non-touch devices.

Anyone already tackled something like this? If not, I'm willing to take a shot at it and share.

Geert-Jan

rowanbeentje commented 11 years ago

Hi Geert-Jan,

In its current state, ftscroller isn't really suitable for a carousel – it uses a layer as large as the content within it, taking up quite a bit of graphics memory for large areas of content. While it would be possible to hack together a carousel with it by hacking together some positioning changes at the end of scrolls, what you really want for a carousel is a number of individual panes which can be moved around behind the scenes as the user scrolls, changing their content as appropriate (eg http://media.smashingmagazine.com/wp-content/uploads/2013/05/the-gallery_mini.jpg ).

@matthew-andrews is currently starting to split ftscroller out into a number of components (yay!), which would include splitting out the input handling; once he's done that it'd be great to add gallery functionality, because you're right, it uses much of the same logic.

0xgeert commented 11 years ago

Great, I guess given the "gallery" as used in the awesome FT ipad app, the functionality is already there as you mention.

Following this would great interest. Thanks.