This new AnythingSlider is an attempt at bringing together the functionality of all of those previous sliders and adding new features. In other words, to create a really “full featured” slider that could be widely useful. This is the first time (on CSS-Tricks) that one of these sliders is an actual plugin as well, which should make implementing it and customizing it much easier.
- Slides are HTML Content (can be anything)
- Next Slide / Previous Slide Arrows
- Navigation tabs are built and added dynamically (any number of slides)
- Optional custom function for formatting navigation text
- Auto-playing (optional feature, can start playing or stopped)
- Each slide has a hashtag (can link directly to specific slides)
- Infinite/Continuous sliding (always slides in the direction you are going, even at “last” slide)
- Multiple sliders allowable per-page (hashtags only work on first)
- Pauses autoPlay on hover (option)
- Link to specific slides from static text links
- ….and…. …wait for it…. more!
Just add or remove moreitems from the list inside , everything else happens automatically.
For example, if you wanted to make the slides 580px wide instead of 680px wide, you just need to change some CSS. Change the width of .anythingSlider ul li to 580px, change the width of .anythingSlider .wrapper to 580px, and reduce the width of .anythingSlider 100px to 660px.
Linking Directly To Slides from Static Links
Target the link using and ID or Class (or whatever), and apply a click handler. Then call the plugin function and pass it a number of the slide you are trying to link to: