title: JQuery UI Slider Uncaught TypeError: Cannot read property 'addClass' of undefined
body: <p>I've checked all of the questions on SO and I can't seem to find the answer. If I place integers directly into the fields then this works but I want to set the parameters dynamically when I set up my script </p>
  
  <p>I'm running JQuery 1.11.1, JQuery UI stable (1.11.0) and touchpunch. I've debugged and the variables are all present and initialised when this is invoked. I've also tried wrapping in self-executing functions with the same results. </p>
  
  <p>(The slide function can be disregarded)</p>
  
  <p>This throws the exception</p>
  
  <p><strong>EDIT</strong> I've just noticed that if I click on the slider the exception is thrown but if I then press the right arrow key no exception is thrown and the amount is populated with the value property. I've pasted console output at the end of the question.</p>
  
  <pre><code>$("#slider").slider({
              value: parseInt(window.settings.principal.minimum),
              min: parseInt(window.settings.principal.minimum),
              max: parseInt(window.settings.principal.maximum),
              step: parseInt(window.settings.principal.increment),
              slide: function(event, ui) {
                  $( "#amount" ).val( "$" + $( "#slider").slider( "value"));
              }
          });
  </code></pre>
  
  <p>However this WILL work </p>
  
  <pre><code>$("#slider").slider({
              value: 500,
              min: 500,
              max: 10000,
              step: 500,
              slide: function(event, ui) {
                  $( "#amount" ).val( "$" + $( "#slider").slider( "value"));
              }
          });
  </code></pre>
  
  <p>Console Output</p>
  
  <pre><code>jQuery("#slider").slider("value"); 
  5000
  jQuery("#slider").slider("min"); 
  Error: no such method 'min' for slider widget instance
  jQuery("#slider").slider("minimum"); 
  Error: no such method 'minimum' for slider widget instance
  jQuery("#slider").slider("max"); 
  Error: no such method 'max' for slider widget instance
  jQuery("#slider").slider("interval"); 
  Error: no such method 'interval' for slider widget instance
  jQuery("#slider").slider("step"); 
  Error: no such method 'step' for slider widget instance
  jQuery("#slider").slider("values"); 
  []
  </code></pre>