title: jQuery UI - Slider - How to add values
body: <p><a href="http://jsfiddle.net/LLfWd/318/" rel="nofollow">fiddle</a> - I've got set of values. Is it possible to add new handle or remove some of them without destroying and rebuilding slide instance?</p>
  
  <p>Something like <code>$('#slider').slider('addValueAt',5);</code> or remove.</p>
  
  <p>New value cannot be equal to any of actual, so there may be no more than 12 values.</p>
  
  <p>Its custom code I've got alredy.</p>
  
  <pre><code>$(function () {
      var handlers = [0, 2, 4 , 9, 12];
      $("#slider").slider({
          min: 0,
          max: 12,
          values: handlers,
          slide: function (evt, ui) {
              for (var i = 0, l = ui.values.length; i &lt; l; i++) {
                  if (i !== l - 1 &amp;&amp; ui.values[i] + 1 &gt; ui.values[i + 1]) {
                      return false;
                  }
                  else if (i === 0 &amp;&amp; ui.values[i] + 1 &lt; ui.values[i - 1]) {
                      return false;
                  }
              }
          }
      });
  });
  </code></pre>
  
  <p>I've tried</p>
  
  <pre><code>$("#slider").slider('option','values', newArrayOfValues);
  </code></pre>
  
  <p>But it only moves actual values, not removing or adding new</p>