I would like to show the array item in one by one fashion with next & previous similar to slideshow.
When my page loads i am storing data from my db in this  way->## Heading ## 
 var sampleTags = <?php echo json_encode($query); ?>; 
i.e
var sampleTags = ["quote 1", "quote 2", "quote 3","quote 4", "quote 5", "quote 6", "quote 7"];
So, now i would like to show one by one item from  this ( sampleTags) array , with previous and next link.
For this i tried:
main point for next is:
curIdx = (curIdx+1) / max;
and previous:
 curIdx = (curIdx+max-1) / max;
But i don'nt know why its not working
here is link Fiddle Please help me to solve this issue.
 
    