Add a swipeable image carousel to a mobile website without a heavy framework.
Build a touch-friendly slideshow that auto-advances on a timer and loops endlessly.
Control a content slider programmatically with next, previous, and jump-to-slide buttons.
Swipe is a small JavaScript library that turns a set of HTML elements into a touch-friendly slider. You wrap your content inside two nested containers, point Swipe at the outer one, and it handles all the swiping behavior, including touch gestures on phones and tablets, arrow-based transitions on desktop, and auto-advancing if you want a slideshow effect. Setup requires adding a few lines of CSS to control how the containers sit on the page, then calling the Swipe function once after the page has loaded. From that point the library manages sliding between items automatically when a user swipes or when your own code triggers a transition. Options include setting which slide appears first, controlling how fast transitions animate, enabling an automatic slideshow with a custom interval, and looping endlessly so there is no hard stop at the first or last item. The library also exposes a small API for controlling the slider from your own scripts: you can move to the previous or next slide, jump to a specific position, or ask for the current position and total slide count. Two callback hooks let you run custom code whenever a slide changes and again when the transition animation finishes. Swipe works in all major browsers and falls back gracefully in older environments like IE7 by detecting whether CSS transitions and touch events are available and choosing the right animation method for each case. The README notes that CNN, Craigslist, Airbnb, and the NHL have used it. The project is released under the MIT license. The README is brief and focused entirely on usage, so there is no deeper documentation on internals or contribution guidelines.
← thebird on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.