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?
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.
http://codepen.io/anon/pen/lozFt
Hope this helps :)
Awesome! Works great! Thank you very much, Dillion :)