Slides are defined by?ms-slide
?class name in the slider markup. To add a new slide to the slider, you need to add a new element as a first level child of slider element. Slider shows the slides in the same order of added slides in the markup, unless,?shuffle
?option was set in the options.
There is no limit in the type of the slide element, you can use?div
,?section
,?article
, or any other semantic HTML5 elements.
You may need to add some parameters to the slide, slide parameters will be specified by data attributes over the slide element. For more information check out Slide Parameters article.
Note: Master Slider does not support to add new slides after the initiation. This article only describes how to add new slide before slider initialization.
The following example creates a slider with three slides:
<div id="masterslider" class="master-slider"> <div class="ms-slide"> <!-- slide content here --> </div> <div class="ms-slide"> <!-- slide content here --> </div> <div class="ms-slide"> <!-- slide content here --> </div> </div>