title: How to bind jQuery UI option to a Knockout observable
body: <p>This <a href="http://jsfiddle.net/jearles/Dt7Ka/" rel="nofollow">fiddle</a> shows how to bind a jQuery slider 'slide' event to a Knockout observable.  How would this need to change to also bind the 'max' option of the slider to an observable?  Do you have to create an entirely new ko.bindingsHandler entry?  Or can the existing one be used?</p>
  
  <p>Here is the code from the fiddle for reference.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;h2&gt;Slider Demo&lt;/h2&gt;
  
  Savings: &lt;input data-bind="value: savings, valueUpdate: 'afterkeydown'" /&gt;
  &lt;div style="margin: 10px" data-bind="slider: savings, sliderOptions: {min: 0, max: 100, range: 'min', step: 1}"&gt;&lt;/div&gt;
  
  Spent: &lt;input data-bind="value: spent, valueUpdate: 'afterkeydown'" /&gt;
  &lt;div style="margin: 10px" data-bind="slider: spent, sliderOptions: {min: 0, max: 100, range: 'min', step: 1}"&gt;&lt;/div&gt;
  
  Net: &lt;span data-bind="text: net"&gt;&lt;/span&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>ko.bindingHandlers.slider = {
    init: function (element, valueAccessor, allBindingsAccessor) {
      var options = allBindingsAccessor().sliderOptions || {};
      $(element).slider(options);
      ko.utils.registerEventHandler(element, "slidechange", function (event, ui) {
          var observable = valueAccessor();
          observable(ui.value);
      });
      ko.utils.domNodeDisposal.addDisposeCallback(element, function () {
          $(element).slider("destroy");
      });
      ko.utils.registerEventHandler(element, "slide", function (event, ui) {
          var observable = valueAccessor();
          observable(ui.value);
      });
    },
    update: function (element, valueAccessor) {
      var value = ko.utils.unwrapObservable(valueAccessor());
      if (isNaN(value)) value = 0;
      $(element).slider("value", value);
  
    }
  };
  
  
  var ViewModel = function() {
      var self = this;
  
      self.savings = ko.observable(10);
      self.spent = ko.observable(5);
      self.net = ko.computed(function() {
          return self.savings() - self.spent();
      });
  }
  
  ko.applyBindings(new ViewModel());
  </code></pre>