Slider value incorrect?

Slider value incorrect?

I'm having trouble implementing a slider. When defining the change and slide events, I set a span's html to the slider's current value, however, the displayed value seems to be one step behind that of the slider. You can try my form out here (the slider is displayed after a job title is chosen).

For instance, if you chose Certified Nurse Aide, the slider correctly interprets the min and max values as 11 and 16, as evidenced by showing the specified value (13.5) directly at the center of the slider. However, once the slider is drug or changed by clicking the bar, the value does not change. Any changes subsequent to the first one reflect the previous change.

When using the stop event instead of slide and change, the values shown are as expected, however, I need them to change without releasing the slider.

The relevant code is below:

HTML:
  1. <div id='baseRate'><span id='baseRateLow'></span><div id='baseRateSlider'></div><span id='baseRateHigh'></span><span id='baseRateTotal'></span></div>
jQuery:
  1. $('#baseRateSlider').slider({ value: 0, min: 0, max: 0 });

  2. $('#baseRateSlider').slider('option','max',baseHigh); //where baseHigh is calculated based on form selections
  3. $('#baseRateSlider').slider('option','min',baseLow); //where baseLow is calculated based on form selections
  4. $('#baseRateSlider').slider('option','value',baseAvg); //where baseAvg is the average of baseLow and baseHigh

  5. $('#baseRateSlider').slider({ slide: function(event,ui) { $('#baseRateTotal').html("$" + $('#baseRateSlider').slider('option','value')); change: function(event,ui) { $('#baseRateTotal').html("$" + $('#baseRateSlider').slider('option','value')); } } });
The correct jQuery to achieve this effect would be:

  1. $('#baseRateSlider').slider({

          slide: function(event, ui) {

                $('#baseRateTotal').html('$' + ui.value);
          },
          change: function(event, ui) {

                $('#baseRateTotal').html('$' + ui.value);
          }
    });