SOURCE CODE: Basic Slider
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Basic Slider | JavaScript Examples | UIZE JavaScript Framework</title>
<meta name="keywords" content="Uize.Widget.Bar.Slider"/>
<meta name="description" content="See a very basic example of a slider widget that lets you select a value in the range of 0 to 200, with a display of the currently selected value."/>
<link rel="alternate" type="application/rss+xml" title="UIZE JavaScript Framework - Latest News" href="http://www.uize.com/latest-news.rss"/>
<link rel="stylesheet" href="../css/page.css"/>
<link rel="stylesheet" href="../css/page.example.css"/>
</head>
<body>
<script type="text/javascript" src="../js/Uize.js"></script>
<h1 class="document-title">
<a id="page-homeLink" href="../index.html" title="UIZE JavaScript Framework home"></a>
<a href="../javascript-examples.html" class="breadcrumb breadcrumbWithArrow">JAVASCRIPT EXAMPLES</a>
Basic Slider
<div id="page-actions" class="pageActions">
<a href="source-code/slider.html" class="buttonLink">SOURCE</a>
</div>
</h1>
<div class="main">
<!-- explanation copy -->
<div class="explanation">
<p>In this very basic slider example, an instance of <a href="../reference/Uize.Widget.Bar.Slider.html"><code>Uize.Widget.Bar.Slider</code></a> is being wired up to slider markup in the page. The slider simply allows for selection of a value in the range of 0 to 200. The markup in the page helps to illustrate the DOM structure and implied nodes expected by the <code>Uize.Widget.Bar.Slider</code> class.</p>
</div>
<!-- slider UI -->
<div style="position:relative; left:0px; top:0px; width:54px; height:341px; background:#455; margin:auto;">
<div id="page_slider-track" style="position:absolute; left:2px; top:2px; width:50px; height:315px; cursor:pointer;">
<img src="../js/Uize_Widget_Bar_Slider/track-bg-vertical.gif" style="position:absolute; left:0; top:0; width:100%; height:100%;" alt=""/>
<img id="page_slider-knob" src="../js/Uize_Widget_Bar_Slider/knob-vertical.gif" style="position:absolute; left:0; top:0; width:50px; height:35px; cursor:pointer;" border="0" hspace="0" vspace="0" alt=""/>
</div>
<div id="page_slider-value" style="position:absolute; left:2px; top:319px; width:50px; height:20px; font-family:Arial; font-size:17px; font-weight:bold; color:#555; background:#adbebf url(../images/brushed-metal.jpg) repeat left top; text-align:center;"></div>
</div>
</div>
<!-- JavaScript code to make the static slider HTML "come alive" -->
<script type="text/javascript">
Uize.module ({
required:[
'UizeSite.Page.Example.library',
'UizeSite.Page.Example',
'Uize.Widget.Bar.Slider'
],
builder:function () {
/*** create the example page widget ***/
var page = window.page = UizeSite.Page.Example ();
/*** add the Uize.Widget.Bar.Slider child widget ***/
page.addChild ('slider',Uize.Widget.Bar.Slider,{minValue:0,maxValue:200});
/*** wire up the page widget ***/
page.wireUi ();
}
});
</script>
</body>
</html>