SOURCE CODE: Slideshow With Wipes

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
  <title>Slideshow With Wipes | JavaScript Examples | UIZE JavaScript Framework</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="keywords" content="featured animation widget slideshow Uize.Widget.ImageWipe Uize.Widget.ImageWipe.Themes Uize.Widget.SlideShow"/>
  <meta name="description" content="See an example of a JavaScript slideshow widget with stunning image wipe animation effects that you didn't believe were possible with just JavaScript."/>
  <link rel="alternate" type="application/rss+xml" title="UIZE JavaScript Framework - Latest News" href=""/>
  <link rel="stylesheet" href="../css/page.css"/>
  <link rel="stylesheet" href="../css/page.example.css"/>
  <link rel="stylesheet" href="../css/widget.slideshow.css"/>


<script type="text/javascript" src="../js/Uize.js"></script>

<h1 class="header">
  <a id="page-homeLink" href="../index.html" title="UIZE JavaScript Framework home"></a>
  <a href="../index.html" class="homeLinkText" title="UIZE JavaScript Framework home">UIZE JavaScript Framework</a>

<div class="main">
  <h1 class="document-title">
    <a href="../javascript-examples.html" class="breadcrumb breadcrumbWithArrow">JAVASCRIPT EXAMPLES</a>
    Slideshow With Wipes
    <div class="pageActionsShell">
      <div id="page-actions" class="pageActions"><a href="source-code/slideshow-with-wipes.html" class="buttonLink">SOURCE</a></div>

  <!-- explanation copy -->

  <div class="explanation">
    <p>In this example, an instance of <a href="../reference/Uize.Widget.SlideShow.html"><code>Uize.Widget.SlideShow</code></a> is used to present a slideshow interface that allows us to step through a series of images. The images are displayed with a sophisticated wipe transition effect between them using JavaScript animation. This is achieved by using an instance of the <a href="../reference/Uize.Widget.ImageWipe.html"><code>Uize.Widget.ImageWipe</code></a> widget class, which is added as a child widget of the slideshow widget, with a child widget name that maps it to the <code>image</code> property of the slide records.</p>

  <div id="page-slideShow"></div>

<!-- JavaScript code to wire up the page and insert the slideshow -->

<script type="text/javascript">

Uize.require (
  function () {
    'use strict';

    /*** create the example page widget ***/
      var page = = UizeSite.Page.Example ();

    /*** add the slide show child widget ***/
      var slideShow = page.addChild (
          slides:UizeSite.TestData.Photos ()

      /*** add the image wipe widget as a child widget to the slide show widget ***/
        slideShow.addChild ('slideImage',Uize.Widget.ImageWipe,{built:false});

    /*** code for cycling the wipe effects ***/
      /* TO DO: this should be factored out for greater ease */
        imageWipeThemes = Uize.Widget.ImageWipe.Themes (),
        imageWipeThemeNames = Uize.Array.Order.jumble (Uize.keys (imageWipeThemes)),
        imageWipeThemeNo = -1
      slideShow.wire (
        function () {
          slideShow.children.slideImage.set (
            imageWipeThemes [
              imageWipeThemeNames [imageWipeThemeNo = (imageWipeThemeNo + 1) % imageWipeThemeNames.length]

    /*** wire up the page widget ***/
      page.wireUi ();