I’m creating a custom content slider using jQuery. Please see the pen [here](http://codepen.io/Isuru-Nanayakkara/pen/ufxgG “”) 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?