There is a list of buttons, some of which are hidden.

You need to create a slide, which when you clicked on the "next" button switched to the next button, and if it is hidden, it showed this hidden button, when switching to the next hidden button, the previous one should disappear, and the current one should appear.

When switching to hidden buttons, the main buttons must maintain their state.

HTML

// Cписок с ΠΊΠ½ΠΎΠΏΠΊΠ°ΠΌΠΈ <ul> <li class="slide visible"><button class="btn"/>Button Visible One</li> <li class="slide visible"><button class="btn"/>Button Visible Two</li> <li class="slide hidden"><button class="btn"/>Button Hidden One</li> <li class="slide hidden"><button class="btn"/>Button Hidden Two</li> </ul> // Кнопки для пСрСдвиТСния <button id="previous">Previos</button> <button id="next">Next</button> 

CSS

 .hidden { display: none; } .visible { display: block; } 
  • What part of the task did you do, what were the difficulties? Show the code that you have to the current moment. - AK ♦
  • The code is simply very large, so I decided to form my request as accurately as possible. Well, I have a list in it of 4 buttons, the first two have a class "visible", and those are a class "hidden." I also have buttons forwards and backwards that go through this list. I need that when I scroll forward and get to the 3 button, i.e. to the first hidden button, it became visible, and when I turn to 4 hidden buttons, then the third one disappears, and 4 becomes visible. Regardless of everything, the first two buttons should always be visible and in their places. I would be very grateful if you could help. - Alisa Bondarchuk
  • HTML // List with buttons <ul> <li class = "slide visible"> <button class = "btn" /> Button Visible One </ li> <li class = "slide visible"> <button class = "btn" /> Button Visible Two </ li> <li class = "slide hidden"> <button class = "btn" /> Button Hidden One </ li> <li class = "slide hidden"> <button class = "btn" /> Button Hidden Two </ li> </ ul> // Buttons to move <button id = "previous"> Previos </ button> <button id = "next"> Next </ button> CSS. hidden {display: none; } .visible {display: block; } JS - Alisa Bondarchuk
  • Add code with html and js to the question. In the comments code is very difficult to read. The edit button is in question. - Stepan Kasyanenko
  • Added changes. - Alisa Bondarchuk

0