title: Problems with Jquery ui slider slide function
body: <p>Using the second answer to <a href="https://stackoverflow.com/questions/10485075/slider-with-multiple-handle-and-background-color-for-content">this question</a> I wrote a code for a 4 handle jquery slider. It was working fine but then I had to make multiple sliders in the same page, so I tried to module my code a bit, separating the slide function. Now the handlers in a slider overlap completely ignoring the condition I set for that case.</p>
  
  <p>Here is the code for my slide function and how I call it in the slider settings:</p>
  
  <p>Slide function:</p>
  
  <pre><code>function slidegen(event,ui,index){
  
      //Code for handler 0
      if(ui.handle == $("#weightage_slider_"+index+"_0").get(0)){
          if(ui.values[0] &gt;= ui.values[1]){
  
              /*FOR SOME REASON THE NEXT LINE HAS NO EFFECT*/
  
              $("#weightage_slider_"+index).slider('values', 0, ui.values[1]); 
              return false;
          } else {
              // handle-0 will move
              // update display of colored handle ranges
              $("#weightage_slider_a_"+index).css('left', '0%');
              $("#weightage_slider_a_"+index).css('width', (to100(ui.values[0])+'%'));
              $("#weightage_slider_b_"+index).css('left', (to100(ui.values[0])+'%'));
              $("#weightage_slider_b_"+index).css('width', ((to100(ui.values[1])-to100(ui.values[0]))+'%'));
          }
      }
  
      /*SIMILAR CODE FOR THE REST OF THE HANDLERS HERE*/
  }
  </code></pre>
  
  <p>Slider settings:</p>
  
  <pre><code>$("#weightage_slider_0").slider({ 
      min: 1,
      max: 5,
      step: 0.01,
      values: handlers, // set four handles
      slide: function(event, ui) {
          slidegen(event,ui,0);
      }, 
      change: function(event, ui) {    
          changen(event,ui,0);
      }
  });
  </code></pre>
  
  <p>I understand that during a slide, the following sequence occurs: (i) change ui.value (ii) call slider function (iii) move the slider handle. Could it be that the bug happens because I'm making another call inside the slider function, therefore I'm altering that sequence?</p>