jQuery UI Slider each value switch class
<p>I have a jQuery UI Slider that has a range between 1-100. I want to change the class of a div for each value between 1-100.</p>

<p>How can I most efficiently go through every value between 1-100 and switch a new class for every value?</p>

<p>Answer (this is what eventually worked out):</p>

<pre><code>$( '#slider-container' ).slider({
min: 1,
max: 100,

slide: function() {

    var $activeBackgroundUrl = $('.position_100').css('background');


    return function(event, ui) {
        activeBackgroundUrl = 'url(images/numbers/1'+(ui.value &lt; 10 ? '0' : '')+ ui.value +'.png)';
        $('.position_100').css('background', activeBackgroundUrl);
    };

}()

});
</code></pre>
