The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

Simple content slider with multiple slides

  • # February 11, 2013 at 11:23 am

    I’m creating a custom content slider using jQuery. Please see the pen [here]( “”) for a working example. In this example, I have only 2 slides. When clicked upon the green button the slides to the next one.

    I want to add more slides to this and have the button click to slide to each of them (no previous button). The current jQuery function has the id of the next div hard-coded. Now when I add more slides, this method won’t be effective. I don’t know how to write one function to say, detect the current div you’re in and when clicked next, go to the next one. How can I achieve this?

    Thank you.

    # February 11, 2013 at 5:32 pm

    Hope this helps :)

    # February 12, 2013 at 11:49 am

    Awesome! Works great! Thank you very much, Dillion :)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed