Slider-VariableNumberofSlides
This demonstrates a slider / slideshow that allows for both:
- Multiple instances on a single page, sharing most of the same CSS.
- Variable number of images in the slider.
Steps to use:
HTML
- In the body tag, add
<body onload="slidersInit('slider', 0)">
- For each slider, create an enclosing
<div class="slider">
or<figure class="slider">
. - Add images. (note: not
<SVG>
tags)
CSS
- Edit .slider as desired.
- Edit more specific selectors as desired. (see
#bottom
in example)
Note: You can use a class name other than 'slider', just edit CSS accordingly and pass that name to slidersInit()
.