Skip to content

Commit

Permalink
Show how to style handles to not overlap #1259
Browse files Browse the repository at this point in the history
  • Loading branch information
lgersen committed Oct 29, 2023
1 parent 7ace401 commit 7ff2865
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions documentation/examples-content/styling.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<div style="margin-bottom: 30px;" id="slider"></div>
<strong class="style-head">Fit handles within slider</strong>
<div style="margin-bottom: 30px;" id="slider-fit"></div>
<strong class="style-head">Don't overlap handles</strong>
<div style="margin-bottom: 30px;" id="slider-no-overlap"></div>
<strong class="style-head">Rounded styling</strong>
<div style="margin-bottom: 30px;" class="slider-styled" id="slider-round"></div>
<strong class="style-head">Square styling</strong>
Expand All @@ -32,10 +34,17 @@
<pre><code>
&lt;div id=&quot;slider&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;slider-fit&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;slider-no-overlap&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;slider-styled&quot; id=&quot;slider-round&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;slider-styled&quot; id=&quot;slider-square&quot;&gt;&lt;/div&gt;
</code></pre>

<div class="viewer-header">Don't overlap handles</div>

<div class="viewer-content">
<?php loadShowCSS('styling-no-overlap'); ?>
</div>

<div class="viewer-header">Fit handles withing the slider</div>

<div class="viewer-content">
Expand Down
6 changes: 6 additions & 0 deletions documentation/examples/styling-no-overlap.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#slider-no-overlap .noUi-handle-lower {
right: 0;
}
#slider-no-overlap .noUi-handle-upper {
right: -34px;
}
11 changes: 11 additions & 0 deletions documentation/examples/styling.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ noUiSlider.create(slider, {
}
});

var sliderNoOverlap = document.getElementById('slider-no-overlap');

noUiSlider.create(sliderNoOverlap, {
start: [50, 50],
connect: true,
range: {
'min': 0,
'max': 100
}
});

var sliderFit = document.getElementById('slider-fit');

noUiSlider.create(sliderFit, {
Expand Down

0 comments on commit 7ff2865

Please sign in to comment.