Please note: This page provides documentation for an old version of Kwicks. If possible, you should check out the latest version instead.

Kwicks Example: Slideshow

Demonstrates a minimal slideshow-esque script using the expand method.

Demo

Source

<!DOCTYPE html>
<html>
    <head>
        <title>Kwicks Slideshow Example</title>

        <link rel='stylesheet' type='text/css' href='../jquery.kwicks.css' />
        <style type='text/css'>
            .kwicks {
                width: 515px;
                height: 300px;
            }
            .kwicks > li {
                width: 125px;
                height: 300px;
                background-color: #ccc;
                /* overridden by kwicks but good for when JavaScript is disabled */
                margin-left: 5px;
                float: left;
            }
        </style>
    </head>

    <body>
        <ul class='kwicks kwicks-horizontal'>
            <li class='kwicks-selected'></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>

        <script src='js/jquery-1.8.1.min.js' type='text/javascript'></script>
        <script src='../jquery.kwicks.js' type='text/javascript'></script>

        <script type='text/javascript'>
            $(function() {
                var $slideshow = $('.kwicks').kwicks({
                    size: 125,
                    minSize : 20,
                    spacing : 5
                });

                var numSlides = $slideshow.children().length,
                    speed = 2000,
                    curSlide = 0;

                setInterval(function() {
                    $slideshow.kwicks('expand', ++curSlide % numSlides);
                }, speed);
            });
        </script>
    </body>
</html>