SOURCE CODE: Image Cycle

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
  <title>Image Cycle | JavaScript Examples | UIZE JavaScript Framework</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="keywords" content="animation Uize.Widget.Swap.Image.Cycle Uize.Widget.Swap.Themes"/>
  <meta name="description" content="Create a simple JavaScript slideshow experience with the cycling image swap widget. Each image is revealed with a different swap / transition effect."/>
  <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"/>


<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>
    Image Cycle
    <div class="pageActionsShell">
      <div id="page-actions" class="pageActions"><a href="source-code/swap-image-cycle.html" class="buttonLink">SOURCE</a></div>

  <!-- explanation copy -->

  <div class="explanation">
    <p>In this example, an instance of <a href="../reference/Uize.Widget.Swap.Image.Cycle.html"><code>Uize.Widget.Swap.Image.Cycle</code></a> is wired up to provide a simple cycling slideshow of images, with no navigation. The <code>cycleSettings</code> state property is set to the themes defined by the <a href="../reference/Uize.Widget.Swap.Themes.html"><code>Uize.Widget.Swap.Themes</code></a> module, so each new image shows with a different JavaScript animation transition effect. The buttons below are wired up to call the <code>start</code> and <code>stop</code> instance methods. Click "Start".</p>

  <!-- image cycle HTML layout with UI to be wired up -->

    <a id="page-start" class="buttonLink" href="javascript://">Start</a>
    <a id="page-stop" class="buttonLink" href="javascript://">Stop</a>
  <div id="page_swapImageCycle" style="position:relative; width:500px; height:357px; background:#000; margin:auto; border-width:8px; border-style:solid;" class="insetBorderColor"></div>

<!-- JavaScript code to make the static slideshow HTML "come alive" -->

<script type="text/javascript">

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

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

    /*** create the Uize.Widget.ImageSwap.Cycle object ***/
      page.addChild (
          images:Uize.Data.Util.getColumn (UizeSite.TestData.Photos (),'image'),
          cycleSettings:Uize.Widget.Swap.Themes (),
      ).fade.set ({duration:1500});

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

    /*** wire up start/stop links ***/
      page.wireNode ('start','click',function () {page.children.swapImageCycle.start ()});
      page.wireNode ('stop','click',function () {page.children.swapImageCycle.stop ()});