I am using the code below to show only the first 3 items in an array as default
//Hides all but first 3 items in the array
@$('.question_container')[3..-1].hide()
Now, I want to display the next 3 items in the array when I click on the button, and the subsequent 3 items when I click on the button again (and repeat).
Currently, I am only able to show ALL remaining items in the array on click with the following code
showMoreQuestions: (e) ->
e.preventDefault()
@$('.question_container')[3..-1].show()
false
How can I modify the code above so that I will only display 3 items when I click my button?
I’m guessing here, but if you just selected the ones that were hidden, you should theoretically be able to display the first 3 every time and have it work.