Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I had a quick look at the source, you might be able to hack the jQuery UI slider code to your purposes. I you download jQuery UI 1.8.12, have a look around line 281 in <code>./development-bundle/ui/jquery.ui.slider.js</code>:</p> <pre><code>// workaround for bug #3736 (if both handles of a range are at 0, // the first is always used as the one with least distance, // and moving it is obviously prevented by preventing negative ranges) if( o.range === true &amp;&amp; this.values(1) === o.min ) { index += 1; closestHandle = $( this.handles[index] ); } </code></pre> <p>The bug fix is a good hint where the changes should go, change your condition to the following:</p> <pre><code>if( o.range === true &amp;&amp; index == 0 ) { </code></pre> <p>This makes sure if it's a range slider, you always drag the second one, no matter what you do. You can use your code by downloading a custom jQuery UI minified build without the slider component, then include your hacked one manually, or you can hack the minified code. </p> <p>Look for:</p> <pre><code>if(a.range===true&amp;&amp;this.values(1)===a.min) </code></pre> <p>Change to:</p> <pre><code>if(a.range===true&amp;&amp;g==0) </code></pre> <p>If you don't want to lose the original slider (so you can use it elsewhere on your page), just rename this hacked extension to something else and include it separately.</p> <p>It would be nice to fix the overlapping bug and to add an option to the slider component to make one of the handles fixed, but I'm afraid that's out of the scope of this answer for now. :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload