In this post, we will create a slick slider and later on show you how to show/hide the buttons of the slick slider.
For creating a slick slider just declare many elements with the same class name.
Now, just add two buttons to the left and right corners to slide the images using HTML and declare an onClick method to change the
On Loading the script for the first time, the slideIindex will be set to 1(First Picture) and when the user clicks on either of the button,
the slideIndex will increase or decrease according to it. And the image will be displayed. Display = “none” will hide the pictures and
display = “block” will again show the pictures.
Hiding the Buttons:
For the hiding the buttons you can remove both these lines:
" button onclick="plusDivs(-1)">❮ button" " button onclick="plusDivs(1)">❯ button"
And instead of calling the script using onClick, use setTimeout(function_name, time_in_ms) function to automatically call the function
itself at the set duration of time.