Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Simple content slider with multiple slides

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #42642
    isuru
    Participant

    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?

    Thank you.

    #124113
    CrocoDillon
    Participant
    #124246
    isuru
    Participant

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.