Skip to content
Advertisement

How to show “next” and “previous” buttons of a item in a array?

Im trying to use a array who contains 4 diferent maps. The first element of the array must be “sticked” and change the current element of the array by clicking next. The next button when it reaches to the last item of the array must be showed disabled. The previous button is disabled and when the next is clicked it should be unabled. Im pretty lost right now any suggestion or advice will be very welcomed

JavaScript
JavaScript
JavaScript

Advertisement

Answer

  1. you can not have button name and function calling the same name hence the error in console.

  2. save your iframe in variable and then do iFrame.src = mapsArray[i] inside both back and next functions.

  3. Check the index numbers in functions and accordingly disable the buttons based on first/last/middle number of index array.

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement