Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Slider: Uncaught TypeError: Cannot call method 'addClass' of undefined

I have the following jquery slider code:

    $(function() {
    var select = $( "#ppp" );
    var slider = $( "<div id='slider' style='width:575px;'></div>" ).insertAfter( select ).slider({
        min: 3,
        max: 60,
        range: "min",
        value: window.slidervalue,
        step:3,
        slide: function( event, ui ) {
            select[ 0 ].value = ui.value;

        },
        stop: function( event, ui ) {
            document.getElementById('vpp').innerHTML=ui.value;
            show_products('1','Y','N','N','N','N','Y');
        }
    });

window.slidervalue refers to a number set somewhere else. #ppp refers to When I was using jQuery 1.7.2 everything was going fine. When I however switched over to 1.8.1 it threw an exception: "Uncaught TypeError: Cannot call method 'addClass' of undefined" No idea why...

like image 611
bicycle Avatar asked Sep 01 '12 12:09

bicycle


2 Answers

1.8.1 is now also in testing and development phase and there are some bugs - use 1.7.2 instead if you have no errors with that

like image 168
rahul Avatar answered Oct 31 '22 22:10

rahul


1.8.1 seems to be buggy in some points - i would prefer using 1.7.2 if you have no errors are do you need 1.8?

like image 33
Lukas Olsen Avatar answered Oct 31 '22 22:10

Lukas Olsen