From 0c88f8cdb41142b75faaa1f67bf236577ec4f7cc Mon Sep 17 00:00:00 2001 From: Leon Gersen Date: Thu, 11 Oct 2018 12:18:38 +0200 Subject: [PATCH] Add options and methods reference #848 --- documentation/_run/index.php | 2 +- documentation/assets/base.css | 21 ++ documentation/examples.php | 4 + documentation/reference.php | 348 +++++++++++++++++++++++++++++++ documentation/slider-options.php | 3 + 5 files changed, 377 insertions(+), 1 deletion(-) create mode 100644 documentation/reference.php diff --git a/documentation/_run/index.php b/documentation/_run/index.php index 8b5241da..9d253611 100644 --- a/documentation/_run/index.php +++ b/documentation/_run/index.php @@ -9,7 +9,7 @@ - + diff --git a/documentation/assets/base.css b/documentation/assets/base.css index 27bd47ea..35675825 100644 --- a/documentation/assets/base.css +++ b/documentation/assets/base.css @@ -342,6 +342,27 @@ font: 700 12px/12px Arial; } + .notice { + background-color: #d1ecf1; + border: 1px solid #bee5eb; + border-radius: 4px; + color: #0c5460; + padding: 5px 15px; + } + + .reference-table { + width: 100%; + border-spacing: 0; + border-collapse: collapse; + } + .reference-table th, + .reference-table td { + text-align: left; + border: 1px solid #ccc; + padding: 5px; + } + + @media ( min-width: 800px ) { .index-demo { diff --git a/documentation/examples.php b/documentation/examples.php index 22079755..285620f9 100644 --- a/documentation/examples.php +++ b/documentation/examples.php @@ -23,6 +23,10 @@ +
+
Can't find something? See the full options reference.
+
+ diff --git a/documentation/reference.php b/documentation/reference.php new file mode 100644 index 00000000..07ddf1c7 --- /dev/null +++ b/documentation/reference.php @@ -0,0 +1,348 @@ + + +
+ + +

Options

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionValueRequiredDefault
startarray of "string" or numbertrue[none]
rangeobject, see rangetrue[none]
stepnumberfalse[none]
snapbooleanfalsefalse
formatFormatterfalseAccept all numeric values, output two decimals
ariaFormatFormatterfalseTwo decimals
connectboolean, array of booleanfalsefalse
marginnumberfalse[none]
limitnumberfalse[none]
paddingnumberfalse[none]
orientationstringfalse"horizontal"
directionstringfalse"ltr"
tooltipsboolean, Formatter, array of boolean or Formatter for each handlefalsefalse
animatebooleanfalsetrue
animationDurationnumberfalse300
keyboardSupportbooleanfalsetrue
behaviourstringfalse"tap"
pipsobject, see: pipsfalse[none]
documentElementdocumentElementfalseownerDocument
cssPrefixstringfalse"noUi-"
cssClassesClassListfalse(see code)
+
+
+ +
+ + +

Methods

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodUsageArguments
destroyslider.noUiSlider.destroy()[none]
stepsslider.noUiSlider.steps()[none]
onslider.noUiSlider.on(..., ...)"string", function
offslider.noUiSlider.off(...)"string"
getslider.noUiSlider.get()[none]
setslider.noUiSlider.set(...)[...]
resetslider.noUiSlider.reset()[none]
updateOptionsslider.noUiSlider.updateOptions(...)object
pipsslider.noUiSlider.pips(...)object, see: pips
removePipsslider.noUiSlider.removePips()[none]
+
+
+ +
+ + +

Properties

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyUsageDescription
optionsslider.noUiSlider.optionsReference to the options used to create the slider. Documentation.
targetslider.noUiSlider.targetThe slider element
[disabled]As attributeDisable a slider or individual handles. Documentation.
+
+
+ +
+ + +

Events

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EventCallback
updateEvent Callback
slideEvent Callback
setEvent Callback
changeEvent Callback
startEvent Callback
endEvent Callback
+
+
+ +
+ + +

Event Callback

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ArgumentTypeDescription
thisobjectSlider API
valuesArray of "string"As returned by get
handlenumber0-based index of handle that caused the event
unencodedArray of numberSlider values without formatting applied
tapbooleanWhether the event was a tap
positionsArray of numberHandle positions, in percentages
+
diff --git a/documentation/slider-options.php b/documentation/slider-options.php index 62e18823..36af588b 100644 --- a/documentation/slider-options.php +++ b/documentation/slider-options.php @@ -15,6 +15,9 @@ +
+
For a complete overview of all slider options, method and properties, see reference.
+