我在谷歌上下搜索并没有找到一个简单的解决方案。
这是我的代码的 jist:
var theArray = ["one","two","three","four"];
$('.next').click(function(){
// go forward on the array
})
$('.back').click(function(){
// do backwards on the array from the current position
})
所以,如果用户点击"<button class="next">
我会收到“一”的警报,他们再次点击“下一步”,“二”的警报,等等......
有没有快速的方法来做到这一点?