title: jQuery UI Slider logarithmic scale
body: <p>I'm using this jQuery UI code use for a logarithmic slider:</p>
  
  <pre><code>var minVal = 10;
  var maxVal = 100;
  $("#slider").slider({
      range: true,
      min: minVal,
      max: maxVal / 2,
      values: [minVal, maxVal],
      slide: function(event, ui) {
          $("#amount_min").val(Number(expon(ui.values[0], minVal, maxVal)).toFixed(0));
          $("#amount_max").val(Number(expon(ui.values[1], minVal, maxVal)).toFixed(0));
      }
  });   
  </code></pre>
  
  <p>The <code>expon</code> function is:</p>
  
  <pre><code>function expon(val, min,max) {
      var minv = Math.log(min);
      var maxv = Math.log(max);
      max = max / 2;
  
      // calculate adjustment factor
      var scale = (maxv - minv) / (max - min);
  
      return Math.exp(minv + scale * (val - min));
  }
  </code></pre>
  
  <p><code>#amount_min</code> and <code>#amount_max</code> are HTML input elements. The code above works just fine to get values from the slider and to put them to the input elements.</p>
  
  <p>But now I need the function opposite to <code>expon()</code> — to change the slider when I change the values of the inputs. Can anybody help me with this?</p>