]> source.dussan.org Git - jquery-ui.git/commitdiff
Slider demos: Coding standards.
authorScott González <scott.gonzalez@gmail.com>
Wed, 13 Oct 2010 14:39:50 +0000 (10:39 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 13 Oct 2010 14:39:50 +0000 (10:39 -0400)
13 files changed:
demos/slider/colorpicker.html
demos/slider/default.html
demos/slider/hotelrooms.html
demos/slider/index.html
demos/slider/multiple-vertical.html
demos/slider/range-vertical.html
demos/slider/range.html
demos/slider/rangemax.html
demos/slider/rangemin.html
demos/slider/side-scroll.html
demos/slider/slider-vertical.html
demos/slider/steps.html
demos/slider/tabs.html

index 121249e22cd17f87f0815941e6c8f78ad93a9b61..e6972cb41414e1b163e9d249e4bdc8458c055eaa 100644 (file)
@@ -1,16 +1,16 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8">
        <title>jQuery UI Slider - Colorpicker</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.slider.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.mouse.js"></script>
+       <script src="../../ui/jquery.ui.slider.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
        #red, #green, #blue {
                float: left;
                clear: left;
        #blue .ui-slider-handle { border-color: #729fcf; }
        #demo-frame > div.demo { padding: 10px !important; };
        </style>
-       <script type="text/javascript">
-       function hexFromRGB (r, g, b) {
+       <script>
+       function hexFromRGB(r, g, b) {
                var hex = [
-                       r.toString(16),
-                       g.toString(16),
-                       b.toString(16)
+                       r.toString( 16 ),
+                       g.toString( 16 ),
+                       b.toString( 16 )
                ];
-               $.each(hex, function (nr, val) {
-                       if (val.length == 1) {
-                               hex[nr] = '0' + val;
+               $.each( hex, function( nr, val ) {
+                       if ( val.length === 1 ) {
+                               hex[ nr ] = "0" + val;
                        }
                });
-               return hex.join('').toUpperCase();
+               return hex.join( "" ).toUpperCase();
        }
        function refreshSwatch() {
-               var red = $("#red").slider("value")
-                       ,green = $("#green").slider("value")
-                       ,blue = $("#blue").slider("value")
-                       ,hex = hexFromRGB(red, green, blue);
-               $("#swatch").css("background-color", "#" + hex);
+               var red = $( "#red" ).slider( "value" ),
+                       green = $( "#green" ).slider( "value" ),
+                       blue = $( "#blue" ).slider( "value" ),
+                       hex = hexFromRGB( red, green, blue );
+               $( "#swatch" ).css( "background-color", "#" + hex );
        }
        $(function() {
-               $("#red, #green, #blue").slider({
-                       orientation: 'horizontal',
+               $( "#red, #green, #blue" ).slider({
+                       orientation: "horizontal",
                        range: "min",
                        max: 255,
                        value: 127,
                        slide: refreshSwatch,
                        change: refreshSwatch
                });
-               $("#red").slider("value", 255);
-               $("#green").slider("value", 140);
-               $("#blue").slider("value", 60);
+               $( "#red" ).slider( "value", 255 );
+               $( "#green" ).slider( "value", 140 );
+               $( "#blue" ).slider( "value", 60 );
        });
        </script>
 </head>
@@ -73,8 +73,8 @@
 <div class="demo">
 
 <p class="ui-state-default ui-corner-all ui-helper-clearfix" style="padding:4px;">
-<span class="ui-icon ui-icon-pencil" style="float:left; margin:-2px 5px 0 0;"></span>
-Simple Colorpicker
+       <span class="ui-icon ui-icon-pencil" style="float:left; margin:-2px 5px 0 0;"></span>
+       Simple Colorpicker
 </p>
 
 <div id="red"></div>
@@ -85,10 +85,10 @@ Simple Colorpicker
 
 </div><!-- End demo -->
 
-<div class="demo-description" style="clear:left;">
 
-<p>Combine three sliders to create a simple RGB colorpicker.</p>
 
+<div class="demo-description" style="clear:left;">
+<p>Combine three sliders to create a simple RGB colorpicker.</p>
 </div><!-- End demo-description -->
 
 </body>
index d63086b4d05c0df1fb9a89a06036a0022a60918e..0f029c505b8db0cc7e06d92420b309e91d0d3b3f 100644 (file)
@@ -1,21 +1,21 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8" >
        <title>jQuery UI Slider - Default functionality</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.slider.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-               #demo-frame > div.demo { padding: 10px !important; }
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.mouse.js"></script>
+       <script src="../../ui/jquery.ui.slider.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
+       #demo-frame > div.demo { padding: 10px !important; }
        </style>
-       <script type="text/javascript">
+       <script>
        $(function() {
-               $("#slider").slider();
+               $( "#slider" ).slider();
        });
        </script>
 </head>
 
 </div><!-- End demo -->
 
-<div class="demo-description">
 
-<p>The basic slider is horizontal and has a single handle that can be moved with the mouse or by using the arrow keys.</p>
 
+<div class="demo-description">
+<p>The basic slider is horizontal and has a single handle that can be moved with the mouse or by using the arrow keys.</p>
 </div><!-- End demo-description -->
 
 </body>
index 02f8b772ff9ae44f667ba6a3e7af6ddd5d7ceb6c..6d35ca737b5870fb0d08b7c966c867baae0160a8 100644 (file)
@@ -1,32 +1,32 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8">
        <title>jQuery UI Slider - Range with fixed minimum</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.slider.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-               #demo-frame > div.demo { padding: 10px !important; };
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.mouse.js"></script>
+       <script src="../../ui/jquery.ui.slider.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
+       #demo-frame > div.demo { padding: 10px !important; };
        </style>
-       <script type="text/javascript">
+       <script>
        $(function() {
-               var select = $("#minbeds");
-               var slider = $('<div id="slider"></div>').insertAfter(select).slider({
+               var select = $( "#minbeds" );
+               var slider = $( "<div id='slider'></div>" ).insertAfter( select ).slider({
                        min: 1,
                        max: 6,
                        range: "min",
-                       value: select[0].selectedIndex + 1,
-                       slide: function(event, ui) {
-                               select[0].selectedIndex = ui.value - 1;
+                       value: select[ 0 ].selectedIndex + 1,
+                       slide: function( event, ui ) {
+                               select[ 0 ].selectedIndex = ui.value - 1;
                        }
                });
-               $("#minbeds").click(function() {
-                       slider.slider("value", this.selectedIndex + 1);
+               $( "#minbeds" ).change(function() {
+                       slider.slider( "value", this.selectedIndex + 1 );
                });
        });
        </script>
 
 </div><!-- End demo -->
 
-<div class="demo-description">
 
-<p>How to bind a slider to an existing select element. The select stays visible to display the change. When the select is changed, the slider is updated, too.</p>
 
+<div class="demo-description">
+<p>How to bind a slider to an existing select element. The select stays visible to display the change. When the select is changed, the slider is updated, too.</p>
 </div><!-- End demo-description -->
 
 </body>
index ec9a2f4f3f1f6e67cb11dd3e6a0a31e6c16ae932..caf68fe978c94ac0709396093d3e925a8a1d417f 100644 (file)
@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8">
        <title>jQuery UI Slider Demos</title>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
+       <link rel="stylesheet" href="../demos.css">
 </head>
 <body>
 
index 62d0b163443285f20e586a710bbfed4e9f738723..1ee91bc71b09c0c89b110dee61dea6867e95e8c2 100644 (file)
@@ -1,35 +1,35 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8">
        <title>jQuery UI Slider - Multiple sliders</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.slider.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-               #demo-frame > div.demo { padding: 10px !important; }
-               #eq span {
-                       height:120px; float:left; margin:15px
-               }
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.mouse.js"></script>
+       <script src="../../ui/jquery.ui.slider.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
+       #demo-frame > div.demo { padding: 10px !important; }
+       #eq span {
+               height:120px; float:left; margin:15px
+       }
        </style>
-       <script type="text/javascript">
+       <script>
        $(function() {
                // setup master volume
-               $("#master").slider({
+               $( "#master" ).slider({
                        value: 60,
                        orientation: "horizontal",
                        range: "min",
                        animate: true
                });
                // setup graphic EQ
-               $("#eq > span").each(function() {
+               $( "#eq > span" ).each(function() {
                        // read initial values from markup and remove that
-                       var value = parseInt($(this).text());
-                       $(this).empty().slider({
+                       var value = parseInt( $( this ).text(), 10 );
+                       $( this ).empty().slider({
                                value: value,
                                range: "min",
                                animate: true,
 <div class="demo">
 
 <p class="ui-state-default ui-corner-all ui-helper-clearfix" style="padding:4px;">
-<span class="ui-icon ui-icon-volume-on" style="float:left; margin:-2px 5px 0 0;"></span>
-Master volume
+       <span class="ui-icon ui-icon-volume-on" style="float:left; margin:-2px 5px 0 0;"></span>
+       Master volume
 </p>
 
 <div id="master" style="width:260px; margin:15px;"></div>
 
 <p class="ui-state-default ui-corner-all" style="padding:4px;margin-top:4em;">
-<span class="ui-icon ui-icon-signal" style="float:left; margin:-2px 5px 0 0;"></span>
-Graphic EQ
+       <span class="ui-icon ui-icon-signal" style="float:left; margin:-2px 5px 0 0;"></span>
+       Graphic EQ
 </p>
 
 <div id="eq">
@@ -67,10 +67,10 @@ Graphic EQ
 
 </div><!-- End demo -->
 
-<div class="demo-description" style="clear:left;">
 
-<p>Combine horizontal and vertical sliders, each with their own options, to create the UI for a music player.</p>
 
+<div class="demo-description" style="clear:left;">
+<p>Combine horizontal and vertical sliders, each with their own options, to create the UI for a music player.</p>
 </div><!-- End demo-description -->
 
 </body>
index 70fbb47b39603993adea149118906a9115196538..6244d3b4094239aaa82e28b30da402d1b25f2e39 100644 (file)
@@ -1,29 +1,30 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8">
        <title>jQuery UI Slider - Vertical range slider</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.slider.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-               #demo-frame > div.demo { padding: 10px !important; };
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.mouse.js"></script>
+       <script src="../../ui/jquery.ui.slider.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
+       #demo-frame > div.demo { padding: 10px !important; };
        </style>
-       <script type="text/javascript">
+       <script>
        $(function() {
-               $("#slider-range").slider({
+               $( "#slider-range" ).slider({
                        orientation: "vertical",
                        range: true,
-                       values: [17, 67],
-                       slide: function(event, ui) {
-                               $("#amount").val('$' + ui.values[0] + ' - $' + ui.values[1]);
+                       values: [ 17, 67 ],
+                       slide: function( event, ui ) {
+                               $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
                        }
                });
-               $("#amount").val('$' + $("#slider-range").slider("values", 0) + ' - $' + $("#slider-range").slider("values", 1));
+               $( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) +
+                       " - $" + $( "#slider-range" ).slider( "values", 1 ) );
        });
        </script>
 </head>
 <div class="demo">
 
 <p>
-<label for="amount">Target sales goal (Millions):</label>
-<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
+       <label for="amount">Target sales goal (Millions):</label>
+       <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
 </p>
 
 <div id="slider-range" style="height:250px;"></div>
 
 </div><!-- End demo -->
 
-<div class="demo-description">
 
-<p>Change the orientation of the range slider to vertical.  Assign a height value via <code>.height()</code> or by setting the height through CSS, and set the <code>orientation</code> option to "vertical."</p>
 
+<div class="demo-description">
+<p>Change the orientation of the range slider to vertical.  Assign a height value via <code>.height()</code> or by setting the height through CSS, and set the <code>orientation</code> option to "vertical."</p>
 </div><!-- End demo-description -->
 
 </body>
index be4e19af48b8e9c07f2f191720d94df9e2074b6e..baeea6161cb98f004dd7fad0b2bc2b3b281cfdd0 100644 (file)
@@ -1,30 +1,31 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8">
        <title>jQuery UI Slider - Range slider</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.slider.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-               #demo-frame > div.demo { padding: 10px !important; };
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.mouse.js"></script>
+       <script src="../../ui/jquery.ui.slider.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
+       #demo-frame > div.demo { padding: 10px !important; };
        </style>
-       <script type="text/javascript">
+       <script>
        $(function() {
-               $("#slider-range").slider({
+               $( "#slider-range" ).slider({
                        range: true,
                        min: 0,
                        max: 500,
-                       values: [75, 300],
-                       slide: function(event, ui) {
-                               $("#amount").val('$' + ui.values[0] + ' - $' + ui.values[1]);
+                       values: [ 75, 300 ],
+                       slide: function( event, ui ) {
+                               $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
                        }
                });
-               $("#amount").val('$' + $("#slider-range").slider("values", 0) + ' - $' + $("#slider-range").slider("values", 1));
+               $( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) +
+                       " - $" + $( "#slider-range" ).slider( "values", 1 ) );
        });
        </script>
 </head>
 <div class="demo">
 
 <p>
-<label for="amount">Price range:</label>
-<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
+       <label for="amount">Price range:</label>
+       <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
 </p>
 
 <div id="slider-range"></div>
 
 </div><!-- End demo -->
 
-<div class="demo-description">
 
-<p>Set the <code>range</code> option to true to capture a range of values with two drag handles.  The space between the handles is filled with a different background color to indicate those values are selected.</p>
 
+<div class="demo-description">
+<p>Set the <code>range</code> option to true to capture a range of values with two drag handles.  The space between the handles is filled with a different background color to indicate those values are selected.</p>
 </div><!-- End demo-description -->
 
 </body>
index b4f4e1e08dba40b1ddd856b12a35ac1d7b97586b..c37d5d054d4ec46185532b4631679a4cf1c17105 100644 (file)
@@ -1,30 +1,30 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8">
        <title>jQuery UI Slider - Range with fixed maximum</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.slider.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-               #demo-frame > div.demo { padding: 10px !important; };
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.mouse.js"></script>
+       <script src="../../ui/jquery.ui.slider.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
+       #demo-frame > div.demo { padding: 10px !important; };
        </style>
-       <script type="text/javascript">
+       <script>
        $(function() {
-               $("#slider-range-max").slider({
+               $( "#slider-range-max" ).slider({
                        range: "max",
                        min: 1,
                        max: 10,
                        value: 2,
-                       slide: function(event, ui) {
-                               $("#amount").val(ui.value);
+                       slide: function( event, ui ) {
+                               $( "#amount" ).val( ui.value );
                        }
                });
-               $("#amount").val($("#slider-range-max").slider("value"));
+               $( "#amount" ).val( $( "#slider-range-max" ).slider( "value" ) );
        });
        </script>
 </head>
 <div class="demo">
 
 <p>
-<labe for="amount">Minimum number of bedrooms:</label>
-<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
+       <label for="amount">Minimum number of bedrooms:</label>
+       <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
 </p>
 <div id="slider-range-max"></div>
 
 </div><!-- End demo -->
 
-<div class="demo-description">
 
-<p>Fix the maximum value of the range slider so that the user can only select a minimum.  Set the <code>range</code> option to "max."</p>
 
+<div class="demo-description">
+<p>Fix the maximum value of the range slider so that the user can only select a minimum.  Set the <code>range</code> option to "max."</p>
 </div><!-- End demo-description -->
 
 </body>
index 4f146824a877490717edadcc3e934270d9b2a888..b89a59c50970d074c0df63c6b039eb50a950800a 100644 (file)
@@ -1,30 +1,30 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8">
        <title>jQuery UI Slider - Range with fixed minimum</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.slider.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-               #demo-frame > div.demo { padding: 10px !important; };
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.mouse.js"></script>
+       <script src="../../ui/jquery.ui.slider.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
+       #demo-frame > div.demo { padding: 10px !important; };
        </style>
-       <script type="text/javascript">
+       <script>
        $(function() {
-               $("#slider-range-min").slider({
+               $( "#slider-range-min" ).slider({
                        range: "min",
                        value: 37,
                        min: 1,
                        max: 700,
-                       slide: function(event, ui) {
-                               $("#amount").val('$' + ui.value);
+                       slide: function( event, ui ) {
+                               $( "#amount" ).val( "$" + ui.value );
                        }
                });
-               $("#amount").val('$' + $("#slider-range-min").slider("value"));
+               $( "#amount" ).val( "$" + $( "#slider-range-min" ).slider( "value" ) );
        });
        </script>
 </head>
 <div class="demo">
 
 <p>
-<label for="amount">Maximum price:</label>
-<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
+       <label for="amount">Maximum price:</label>
+       <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
 </p>
 
 <div id="slider-range-min"></div>
 
 </div><!-- End demo -->
 
-<div class="demo-description">
 
-<p>Fix the minimum value of the range slider so that the user can only select a maximum.  Set the <code>range</code> option to "min."</p>
 
+<div class="demo-description">
+<p>Fix the minimum value of the range slider so that the user can only select a maximum.  Set the <code>range</code> option to "min."</p>
 </div><!-- End demo-description -->
 
 </body>
index fe5599bee4cc9ed93cbc579d4303300d0f276407..4d9f02e4afe70ed6bf92bf17c02800b9441ea83f 100644 (file)
@@ -1,92 +1,98 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8">
        <title>jQuery UI Slider - Slider scrollbar</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.slider.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-               #demo-frame > div.demo { padding: 10px !important; }
-               .scroll-pane { overflow: auto; width: 99%; float:left; }
-               .scroll-content { width: 2440px; float: left; }
-               .scroll-content-item { width: 100px; height: 100px; float: left; margin: 10px; font-size: 3em; line-height: 96px; text-align: center; }
-               * html .scroll-content-item { display: inline; } /* IE6 float double margin bug */
-               .scroll-bar-wrap { clear: left; padding: 0 4px 0 2px; margin: 0 -1px -1px -1px; }
-               .scroll-bar-wrap .ui-slider { background: none; border:0; height: 2em; margin: 0 auto;  }
-               .scroll-bar-wrap .ui-handle-helper-parent { position: relative; width: 100%; height: 100%; margin: 0 auto; }
-               .scroll-bar-wrap .ui-slider-handle { top:.2em; height: 1.5em; }
-               .scroll-bar-wrap .ui-slider-handle .ui-icon { margin: -8px auto 0; position: relative; top: 50%; }
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.mouse.js"></script>
+       <script src="../../ui/jquery.ui.slider.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
+       #demo-frame > div.demo { padding: 10px !important; }
+       .scroll-pane { overflow: auto; width: 99%; float:left; }
+       .scroll-content { width: 2440px; float: left; }
+       .scroll-content-item { width: 100px; height: 100px; float: left; margin: 10px; font-size: 3em; line-height: 96px; text-align: center; }
+       * html .scroll-content-item { display: inline; } /* IE6 float double margin bug */
+       .scroll-bar-wrap { clear: left; padding: 0 4px 0 2px; margin: 0 -1px -1px -1px; }
+       .scroll-bar-wrap .ui-slider { background: none; border:0; height: 2em; margin: 0 auto;  }
+       .scroll-bar-wrap .ui-handle-helper-parent { position: relative; width: 100%; height: 100%; margin: 0 auto; }
+       .scroll-bar-wrap .ui-slider-handle { top:.2em; height: 1.5em; }
+       .scroll-bar-wrap .ui-slider-handle .ui-icon { margin: -8px auto 0; position: relative; top: 50%; }
        </style>
-       <script type="text/javascript">
+       <script>
        $(function() {
                //scrollpane parts
-               var scrollPane = $('.scroll-pane');
-               var scrollContent = $('.scroll-content');
+               var scrollPane = $( ".scroll-pane" ),
+                       scrollContent = $( ".scroll-content" );
                
                //build slider
-               var scrollbar = $(".scroll-bar").slider({
-                       slide:function(e, ui){
-                               if( scrollContent.width() > scrollPane.width() ){ scrollContent.css('margin-left', Math.round( ui.value / 100 * ( scrollPane.width() - scrollContent.width() )) + 'px'); }
-                               else { scrollContent.css('margin-left', 0); }
+               var scrollbar = $( ".scroll-bar" ).slider({
+                       slide: function( event, ui ) {
+                               if ( scrollContent.width() > scrollPane.width() ) {
+                                       scrollContent.css( "margin-left", Math.round(
+                                               ui.value / 100 * ( scrollPane.width() - scrollContent.width() )
+                                       ) + "px" );
+                               } else {
+                                       scrollContent.css( "margin-left", 0 );
+                               }
                        }
                });
                
                //append icon to handle
-               var handleHelper = scrollbar.find('.ui-slider-handle')
-               .mousedown(function(){
+               var handleHelper = scrollbar.find( ".ui-slider-handle" )
+               .mousedown(function() {
                        scrollbar.width( handleHelper.width() );
                })
-               .mouseup(function(){
-                       scrollbar.width( '100%' );
+               .mouseup(function() {
+                       scrollbar.width( "100%" );
                })
-               .append('<span class="ui-icon ui-icon-grip-dotted-vertical"></span>')
-               .wrap('<div class="ui-handle-helper-parent"></div>').parent();
+               .append( "<span class='ui-icon ui-icon-grip-dotted-vertical'></span>" )
+               .wrap( "<div class='ui-handle-helper-parent'></div>" ).parent();
                
                //change overflow to hidden now that slider handles the scrolling
-               scrollPane.css('overflow','hidden');
+               scrollPane.css( "overflow", "hidden" );
                
                //size scrollbar and handle proportionally to scroll distance
-               function sizeScrollbar(){
+               function sizeScrollbar() {
                        var remainder = scrollContent.width() - scrollPane.width();
                        var proportion = remainder / scrollContent.width();
-                       var handleSize = scrollPane.width() - (proportion * scrollPane.width());
-                       scrollbar.find('.ui-slider-handle').css({
+                       var handleSize = scrollPane.width() - ( proportion * scrollPane.width() );
+                       scrollbar.find( ".ui-slider-handle" ).css({
                                width: handleSize,
-                               'margin-left': -handleSize/2
+                               "margin-left": -handleSize / 2
                        });
-                       handleHelper.width('').width( scrollbar.width() - handleSize);
+                       handleHelper.width( "" ).width( scrollbar.width() - handleSize );
                }
                
                //reset slider value based on scroll content position
-               function resetValue(){
+               function resetValue() {
                        var remainder = scrollPane.width() - scrollContent.width();
-                       var leftVal = scrollContent.css('margin-left') == 'auto' ? 0 : parseInt(scrollContent.css('margin-left'));
-                       var percentage = Math.round(leftVal / remainder * 100);
-                       scrollbar.slider("value", percentage);
+                       var leftVal = scrollContent.css( "margin-left" ) === "auto" ? 0 :
+                               parseInt( scrollContent.css( "margin-left" ) );
+                       var percentage = Math.round( leftVal / remainder * 100 );
+                       scrollbar.slider( "value", percentage );
                }
+               
                //if the slider is 100% and window gets larger, reveal content
-               function reflowContent(){
-                               var showing = scrollContent.width() + parseInt( scrollContent.css('margin-left') );
+               function reflowContent() {
+                               var showing = scrollContent.width() + parseInt( scrollContent.css( "margin-left" ), 10 );
                                var gap = scrollPane.width() - showing;
-                               if(gap > 0){
-                                       scrollContent.css('margin-left', parseInt( scrollContent.css('margin-left') ) + gap);
+                               if ( gap > 0 ) {
+                                       scrollContent.css( "margin-left", parseInt( scrollContent.css( "margin-left" ), 10 ) + gap );
                                }
                }
                
                //change handle position on window resize
-               $(window)
-               .resize(function(){
-                               resetValue();
-                               sizeScrollbar();
-                               reflowContent();
+               $( window ).resize(function() {
+                       resetValue();
+                       sizeScrollbar();
+                       reflowContent();
                });
                //init scrollbar size
-               setTimeout(sizeScrollbar,10);//safari wants a timeout
+               setTimeout( sizeScrollbar, 10 );//safari wants a timeout
        });
        </script>
 </head>
        </div>
 </div>
 
-
-
 </div><!-- End demo -->
 
 
 
 <div class="demo-description">
-
 <p>Use a slider to manipulate the positioning of content on the page. In this case, it acts as a scrollbar with the potential to capture values if needed.</p>
-
 </div><!-- End demo-description -->
 
 </body>
index b6b4027b10b7fffd8d6a07dae9f74a97e72a110f..99be93cbb13c87448c94f5abf5371379aa73abcd 100644 (file)
@@ -1,31 +1,31 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8">
        <title>jQuery UI Slider - Vertical slider</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.slider.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-               #demo-frame > div.demo { padding: 10px !important; };
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.mouse.js"></script>
+       <script src="../../ui/jquery.ui.slider.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
+       #demo-frame > div.demo { padding: 10px !important; };
        </style>
-       <script type="text/javascript">
+       <script>
        $(function() {
-               $("#slider-vertical").slider({
+               $( "#slider-vertical" ).slider({
                        orientation: "vertical",
                        range: "min",
                        min: 0,
                        max: 100,
                        value: 60,
-                       slide: function(event, ui) {
-                               $("#amount").val(ui.value);
+                       slide: function( event, ui ) {
+                               $( "#amount" ).val( ui.value );
                        }
                });
-               $("#amount").val($("#slider-vertical").slider("value"));
+               $( "#amount" ).val( $( "#slider-vertical" ).slider( "value" ) );
        });
        </script>
 </head>
 <div class="demo">
 
 <p>
-<label for="amount">Volume:</label>
-<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
+       <label for="amount">Volume:</label>
+       <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
 </p>
 
 <div id="slider-vertical" style="height:200px;"></div>
 
 </div><!-- End demo -->
 
-<div class="demo-description">
 
-<p>Change the orientation of the slider to vertical.  Assign a height value via <code>.height()</code> or by setting the height through CSS, and set the <code>orientation</code> option to "vertical."</p>
 
+<div class="demo-description">
+<p>Change the orientation of the slider to vertical.  Assign a height value via <code>.height()</code> or by setting the height through CSS, and set the <code>orientation</code> option to "vertical."</p>
 </div><!-- End demo-description -->
 
 </body>
index 66c84b0c3b6d208e9d402e3d909a412e6324529f..df582e725908e349c57eeaea032ad070917cadd6 100644 (file)
@@ -1,30 +1,30 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8">
        <title>jQuery UI Slider - Snap to increments</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.slider.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-               #demo-frame > div.demo { padding: 10px !important; };
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.mouse.js"></script>
+       <script src="../../ui/jquery.ui.slider.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
+       #demo-frame > div.demo { padding: 10px !important; };
        </style>
-       <script type="text/javascript">
+       <script>
        $(function() {
-               $("#slider").slider({
+               $( "#slider" ).slider({
                        value:100,
                        min: 0,
                        max: 500,
                        step: 50,
-                       slide: function(event, ui) {
-                               $("#amount").val('$' + ui.value);
+                       slide: function( event, ui ) {
+                               $( "#amount" ).val( "$" + ui.value );
                        }
                });
-               $("#amount").val('$' + $("#slider").slider("value"));
+               $( "#amount" ).val( "$" + $( "#slider" ).slider( "value" ) );
        });
        </script>
 </head>
 <div class="demo">
 
 <p>
-<label for="amount">Donation amount ($50 increments):</label>
-<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
+       <label for="amount">Donation amount ($50 increments):</label>
+       <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
 </p>
 
 <div id="slider"></div>
 
 </div><!-- End demo -->
 
-<div class="demo-description">
 
-<p>Increment slider values with the <code>step</code> option set to an integer, commonly a dividend of the slider's maximum value.  The default increment is 1.</p>
 
+<div class="demo-description">
+<p>Increment slider values with the <code>step</code> option set to an integer, commonly a dividend of the slider's maximum value.  The default increment is 1.</p>
 </div><!-- End demo-description -->
 
 </body>
index 40916c46a8169bb31da3ce3705624818cbdf907b..7a80a98b087e88233bd5752b2c674d9302a1eae7 100644 (file)
@@ -1,31 +1,31 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8">
        <title>jQuery UI Slider - Snap to increments</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.tabs.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.slider.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-               #demo-frame > div.demo { padding: 10px !important; }
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.mouse.js"></script>
+       <script src="../../ui/jquery.ui.tabs.js"></script>
+       <script src="../../ui/jquery.ui.slider.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
+       #demo-frame > div.demo { padding: 10px !important; }
        </style>
-       <script type="text/javascript">
+       <script>
        $(function() {
-               $("#tabs").tabs({
-                       select: function(event, ui) {
-                               $("#slider").slider("value", ui.index);
+               $( "#tabs" ).tabs({
+                       select: function( event, ui ) {
+                               $( "#slider" ).slider( "value", ui.index );
                        }
                });
-               $("#slider").slider({
+               $( "#slider" ).slider({
                        min: 0,
-                       max: $("#tabs").tabs("length") - 1,
-                       slide: function(event, ui) {
-                               $("#tabs").tabs("select", ui.value);
+                       max: $( "#tabs" ).tabs( "length" ) - 1,
+                       slide: function( event, ui ) {
+                               $( "#tabs" ).tabs( "select", ui.value );
                        }
                });
        });
 
 </div><!-- End demo -->
 
-<div class="demo-description">
 
-<p>Control tabs with a slider.</p>
 
+<div class="demo-description">
+<p>Control tabs with a slider.</p>
 </div><!-- End demo-description -->
 
 </body>