Slideshow

Create a responsive image or video slideshow with stunning transition effects, fullscreen mode and overlays.


Usage

To create a slideshow, just add the .slideshow class to a <ul> element and place your images inside the list items. In order to load the necessary JavaScript, you also need to add the data-slideshow attribute.

Example

Note To activate autoplay, just add the {autoplay:true} option to the data attribute.

Markup

<ul class="slideshow" data-slideshow="{autoplay:true}">
    <li><img src="images/placeholder.svg" width="" height=""></li>
</ul>

To navigate through your slides, just use the data-slideshow-item attribute. To target the slides, you need to set the data attribute of every nav item to the number of the respective slideshow item. The elements with the data-slideshow-item attribute need to be inside the data-slideshow container.

Markup

<div data-slideshow>
    <ul class="slideshow">
        <li></li>
        <li></li>
    </ul>
    <li data-slideshow-item="0"><a href="#">...</a></li>
    <li data-slideshow-item="1"><a href="#">...</a></li>
</div>

Setting the attribute to next and previous will switch to the adjacent slides.

Markup

<div data-slideshow>
    <ul class="slideshow">
        <li></li>
        <li></li>
    </ul>
    <a href="#" data-slideshow-item="previous"></a>
    <a href="#" data-slideshow-item="next"></a>
</div>

Slidenav and Dotnav

The flexibility of the Slideshow component enables you to use any of the other Clique.UI components to navigate through items. For example the Slidenav and Dotnav can be used to style the slideshow navigations as you can see below.

Example

Markup

<div class="slidenav-position" data-slideshow>
    <ul class="slideshow">
        <li></li>
        <li></li>
    </ul>
    <a href="#" class="slidenav slidenav-contrast slidenav-previous" data-slideshow-item="previous"></a>
    <a href="#" class="slidenav slidenav-contrast slidenav-next" data-slideshow-item="next"></a>
    <ul class="dotnav dotnav-contrast position-bottom text-center">
        <li data-slideshow-item="0"><a href="#"></a></li>
        <li data-slideshow-item="1"><a href="#"></a></li>
    </ul>
</div>

Transitions

The Slideshow component allows you to add different animations to items when switching between them. All you need to do is add the animation parameter to the data-attribute and define the animation that you want to apply. Check the table below for an overview of the animations provided.

Class Description
fade The item fades in.
scroll The items scroll in.
scale The items scale up on out.
swipe The items swipe in and out.

Example

  • Fade

  • Scroll

  • Scale

  • Swipe

Markup

<ul class="slideshow" data-slideshow="{animation: 'random-fx'}">...</ul>

Ken Burns effect

The Ken Burns effect can also be applied to slideshow items. Just add the {kenburns:true} option to the data attribute. This effect can also be applied to videos.

Example

Markup

<ul class="slideshow" data-slideshow="{kenburns:true}">...</ul>

Fullscreen slideshow

To create a fullscreen slideshow that stretches to fill the entire viewport, just add the .slideshow-fullscreen class.

Markup

<ul class="slideshow slideshow-fullscreen" data-slideshow>...</ul>

Overlays

You can also enhance slideshows with different overlays. Just add the .overlay-panel to a <div> element inside the list item. Also add .overlay-background and .overlay-fade to show a background and a transition. To toggle the overlay once a slide becomes active add the .overlay-active to the list container. For more options, check out the Overlay component.

Example

  • Overlay

    Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
    sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.

  • Overlay Top

    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.

  • Overlay Bottom

    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.

  • Overlay Left

    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.

  • Overlay Right

    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.

Markup

<ul class="slideshow overlay-active" data-slideshow>
    <li>
        <img src="images/placeholder.svg" width="" height="">
        <div class="overlay-panel overlay-background overlay-fade">...</div>
    </li>
</ul>

Video

Clique.UI allows you to present both video elements and Iframes within a slideshow.

Example

Markup

<!-- This is a slideshow with a video element -->
<ul class="slideshow">
    <li>
        <video width="" height="" autoplay loop muted controls>
            <source src="..." type="">
        </video>
    </li>
</ul>

<!-- This is a slideshow with an Iframe -->
<ul class="slideshow">
    <li>
        <iframe src="images/placeholder.svg" width="" height="" frameborder="0" allowfullscreen></iframe>
    </li>
</ul>

Content

You can basically insert any content, like text or an entire grid as slideshow items.

Example

  • Headline 1

    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.

  • Headline 2

    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.


JavaScript Options

Option Default Description
animation 'fade' Defines the preferred transition between items.
duration 500 Defines the transition duration.
height 'auto' Defines the slideshow height.
start 0 Defines the first slideshow item to be displayed.
autoplay false Defines whether or not the slideshow items should switch automatically.
pauseOnHover true Pause autoplay when hovering a slideshow.
autoplayInterval 7000 Defines the timespan between switching slideshow items.
videoautoplay true Defines whether or not a video starts automatically.
videomute true Defines whether or not a video is muted.
kenburns false Defines whether or not the Ken Burns effect is active.
slices 15 Defines the number of slices, if a "Slice" transition is set.