jQuery UI slider - Cannot call method 'addClass' of undefined

Viewed 20473

I had this old jQuery UI slider that had worked just fine a few months ago, but now I seem to be getting an exception reading: Cannot call method 'addClass' of undefined. I've checked the values being passed into the slider and they're regular Javascript dates.

  $('#dateFilter').click(function() {
    return $('#sliderContainer').slideToggle(200);
  });

  $(function() {
    var endFiling, startFiling;
    startFiling = Date.parse($('#startFiling').val());
    endFiling = Date.parse($('#endFiling').val());
    return $('#filingDateSlider').slider({
      range: true,
      min: startFiling,
      max: endFiling,
      step: 86400000,
      values: [startFiling, endFiling],
      slide: function(event, ui) {
        var eD, end, sD, start;
        sD = new Date(ui.values[0]);
        start = dateFormat(sD);
        eD = new Date(ui.values[1]);
        end = dateFormat(eD);
        $('#filingStartDate').text(start);
        return $('#filingEndDate').text(end);
      }
        });

Is there a particular reason why I might be getting this new error?

http://i.imgur.com/xC2E6.jpg

7 Answers

jQuery UI Slider plugin min & max options accepts only number. So according to your requirement parse them to integer or float.

For details visit link- http://api.jqueryui.com/slider/

Related