SOURCE CODE: Basic Marquee

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
  <title>Basic Marquee | JavaScript Examples | UIZE JavaScript Framework</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="keywords" content="widget touch ipad Uize.Widget.Resizer.Marquee"/>
  <meta name="description" content="See a basic example of the marquee widget in action. Some test links provided let you change some of the widget's configuration options dynamically."/>
  <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"/>
  <style type="text/css">
    input {


<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>
    Basic Marquee
    <div class="pageActionsShell">
      <div id="page-actions" class="pageActions"><a href="source-code/marquee.html" class="buttonLink">SOURCE</a></div>

  <!-- explanation copy -->

  <div class="explanation">
    <p>In this basic example, an instance of <a href="../reference/Uize.Widget.Resizer.Marquee.html"><code>Uize.Widget.Resizer.Marquee</code></a> provides a very simple marquee widget. The marquee is configured so that it cannot be moved outside of its container node, by setting its <code>constrained</code> state property to <code>true</code>. It can be resized to an arbitrary aspect ratio, but it cannot be made smaller than 20x20, accomplished by setting the <code>minWidth</code> and <code>minHeight</code> state properties. A handler is registered for the <code>Position Changed</code> instance event, so that the coordinates of the marquee are displayed (in text inputs to the right) as you move and resize it. Additionally, a new marquee can be created by clicking and dragging in a fresh spot outside the marquee's current area.</p>

  <!-- marquee UI wireframe -->

  <div id="page_marquee" style="width:600px; height:240px; position:relative; margin:auto; margin-bottom:10px;" class="insetBackgroundColor"></div>

  <div class="programmaticInterface">
      <li>Current Position:
        LEFT: <span id="page-marqueePositionLeft"></span>
        TOP: <span id="page-marqueePositionTop"></span>
        WIDTH: <span id="page-marqueePositionWidth"></span>
        HEIGHT: <span id="page-marqueePositionHeight"></span>
      <li>Resizing Configurations
            FIXED WIDTH: <a href="javascript://" class="linkedJs">marquee.set ({fixedX:true,fixedY:false})</a>
            FIXED HEIGHT: <a href="javascript://" class="linkedJs">marquee.set ({fixedX:false,fixedY:true})</a>
            NOT RESIZABLE: <a href="javascript://" class="linkedJs">marquee.set ({fixedX:true,fixedY:true})</a>
            FULLY RESIZABLE: <a href="javascript://" class="linkedJs">marquee.set ({fixedX:false,fixedY:false})</a>
      <li>Different Sizes:
        <a href="javascript://" class="linkedJs">marquee.set ({width:50,height:50})</a>
        <a href="javascript://" class="linkedJs">marquee.set ({width:100,height:100})</a>
        <a href="javascript://" class="linkedJs">marquee.set ({width:300,height:50})</a>
      <li>Nudge Horizontally:
        LEFT: <a href="javascript://" class="linkedJs">marquee.set ({left:marquee.get ('left') - 10})</a>
        RIGHT: <a href="javascript://" class="linkedJs">marquee.set ({left:marquee.get ('left') + 10})</a>
      <li>Nudge Vertically:
        UP: <a href="javascript://" class="linkedJs">marquee.set ({top:marquee.get ('top') - 10})</a>
        DOWN: <a href="javascript://" class="linkedJs">marquee.set ({top:marquee.get ('top') + 10})</a>

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

<script type="text/javascript">

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

    /*** create the example page widget ***/
      var page = = UizeSite.Page.Example ({evaluator:function (code) {eval (code)}});

    /*** add the marquee child widget ***/
      var marquee = page.addChild (

    /*** display marquee position while dragging ***/
      function displayMarqueePosition () {
        page.setNodeValue ('marqueePositionLeft',marquee.get ('left'));
        page.setNodeValue ('marqueePositionTop',marquee.get ('top'));
        page.setNodeValue ('marqueePositionWidth',marquee.get ('width'));
        page.setNodeValue ('marqueePositionHeight',marquee.get ('height'));
      marquee.wire ('Position Changed',displayMarqueePosition);

    /*** display marquee's initial position ***/
      displayMarqueePosition ();

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