From fa760da3bdfb04eda1afe2ca3521be97b57f365e Mon Sep 17 00:00:00 2001 From: John Bender Date: Wed, 22 Dec 2010 23:53:44 -0800 Subject: [PATCH] docs updated with information about the slider keys --- docs/forms/forms-slider.html | 31 ++++++++++++++++-------------- tests/unit/navigation/index.html | 3 ++- tests/unit/slider/index.html | 3 ++- tests/unit/slider/slider_events.js | 4 ++-- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/docs/forms/forms-slider.html b/docs/forms/forms-slider.html index d9bde58e..c816647a 100755 --- a/docs/forms/forms-slider.html +++ b/docs/forms/forms-slider.html @@ -1,14 +1,14 @@ - - + + - - jQuery Mobile Docs - Forms - + + jQuery Mobile Docs - Forms + - - + +
@@ -17,20 +17,20 @@
- +

Sliders

To add a slider widget to your page, start with an input with a new HTML5 type="range" attribute. Specify the value (current value), min and max attribute values to configure the slider. The framework will parse these attributes to configure the slider.

As you drag the slider, the input will update and vice-versa so they are always in sync so you can submit the slider value with form in a simple way. Set the for attribute of the label to match the ID of the input so they are semantically associated and wrap them in a div with the data-role="fieldcontain" attribute to group them.

-
	
+

 <div data-role="fieldcontain">
 	<label for="slider">Input slider:</label>
  	<input type="range" name="slider" id="slider" value="0" min="0" max="100"  />
 </div>
-
- +
+

An example of a slider and input is displayed like this:

@@ -38,15 +38,18 @@

By setting the min and maxattributes you can configure the allowable number range of the slider track. The value of the input is used to configure the starting position of the handle and the value populated in the text input.

- +

The slider with a min of 500, max of 5,000 and initial value of 2,500

- + +

Sliders also respond to the keyboards shortcuts. To increase the current value the Right Arrow, Up Arrow, and Page Up keys can be used. To decrease the current value the Left Arrow, Down Arrow, and Page Down keys can be used. To move the slider to its minimum or maximum value use the Home and End keys respectively.

+ +
- +
diff --git a/tests/unit/navigation/index.html b/tests/unit/navigation/index.html index 528ec126..18d36e16 100644 --- a/tests/unit/navigation/index.html +++ b/tests/unit/navigation/index.html @@ -56,8 +56,9 @@ left: -10000px; } + /* maintain styling */ .ui-mobile-viewport { - padding: 10px; + margin: 8px; } diff --git a/tests/unit/slider/index.html b/tests/unit/slider/index.html index 569694b9..8c190321 100644 --- a/tests/unit/slider/index.html +++ b/tests/unit/slider/index.html @@ -55,8 +55,9 @@ left: -10000px; } + /* maintain styling */ .ui-mobile-viewport { - padding: 10px; + margin: 8px; } diff --git a/tests/unit/slider/slider_events.js b/tests/unit/slider/slider_events.js index 24d4b8ff..db92a231 100644 --- a/tests/unit/slider/slider_events.js +++ b/tests/unit/slider/slider_events.js @@ -36,7 +36,7 @@ }); }); - test( "slider should move to range minimum on end key press", function(){ + test( "slider should move to range minimum on end keypress", function(){ var selector = "#range-slider-end", initialVal = window.parseFloat($(selector).val(), 10), max = window.parseFloat($(selector).attr('max'), 10); @@ -48,7 +48,7 @@ }); }); - test( "slider should move to range minimum on end key press", function(){ + test( "slider should move to range minimum on end keypress", function(){ var selector = "#range-slider-home", initialVal = window.parseFloat($(selector).val(), 10);