diff options
author | Scott González <scott.gonzalez@gmail.com> | 2010-10-13 10:39:50 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2010-10-13 10:39:50 -0400 |
commit | 060af83ec9c78fb34b38388c00bb610410e46ee4 (patch) | |
tree | 39d39b99140aa2a99518c54224b9bdc7579e1f42 /demos/slider/colorpicker.html | |
parent | 3e225de13c49f2735916d26c9057d23b84b9b912 (diff) | |
download | jquery-ui-060af83ec9c78fb34b38388c00bb610410e46ee4.tar.gz jquery-ui-060af83ec9c78fb34b38388c00bb610410e46ee4.zip |
Slider demos: Coding standards.
Diffstat (limited to 'demos/slider/colorpicker.html')
-rw-r--r-- | demos/slider/colorpicker.html | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/demos/slider/colorpicker.html b/demos/slider/colorpicker.html index 121249e22..e6972cb41 100644 --- a/demos/slider/colorpicker.html +++ b/demos/slider/colorpicker.html @@ -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; @@ -32,39 +32,39 @@ #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> |