code: function ($slider) {
      var data = $slider.data();
  
      var $track = data.$track;
      var $fill = data.$fill;
      var $thumb = data.$thumb;
      var $input = data.$input;
      var min = data.min;
      var max = data.max;
      var isDisabled = data.disabled;
      var isDiscrete = data.discrete;
      var $thumbText = data.$thumbText;
      var value = $input.val();
      var percent = (value - min) / (max - min) * 100;
  
      $fill.width(percent + '%');
      $track.width((100 - percent) + '%');
  
      if (isDisabled) {
        $fill.css('padding-right', '6px');
        $track.css('padding-left', '6px');
      }
  
      $thumb.css('left', percent + '%');
  
      if (isDiscrete) {
        $thumbText.text(value);
      }
  
      $slider[parseFloat(percent) === 0 ? 'addClass' : 'removeClass']('mdui-slider-zero');
    }
docs: 滑块的值变更后修改滑块样式
  @param $slider