Skip to content

Commit

Permalink
Show tooltip formatting with a prefix #1257
Browse files Browse the repository at this point in the history
  • Loading branch information
lgersen committed Oct 29, 2023
1 parent 7f8fe0c commit 7ace401
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions documentation/number-formatting/tooltips.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
var tooltipSlider = document.getElementById('slider-tooltips');

noUiSlider.create(tooltipSlider, {
start: [20, 80, 120],
start: [20, 80, 120, 140],
tooltips: [
false, // no tooltip
wNumb({decimals: 1}), // tooltip with custom formatting
true // tooltip with default formatting
// no tooltip
false,
// tooltip with custom formatting
wNumb({decimals: 1}),
// tooltip with default formatting
true,
// tooltip with manual formatting
{ to: function(value) { return '❤️ ' + value; } }
],
/**
* Tooltip with default formatting on all handles:
* tooltips: true,
*
* Tooltip with specific formatting on all handles:
* tooltips: {
* to: ...,
* from: ...
* to: ...
* }
*
* Tooltip with specific formatting on each handle:
* tooltips: [
* { to: ..., from: ... },
* { to: ..., from: ... },
* { to: ..., from: ... },
* { to: ... },
* { to: ... },
* { to: ... },
* ]
*/
range: {
Expand Down

0 comments on commit 7ace401

Please sign in to comment.