can't get noUISlider to work

Juloius picture Juloius · Jul 24, 2015 · Viewed 8.3k times · Source

I can't get noUISlider to work Here my code snippet:

And I'm getting this error: Uncaught TypeError: Cannot read property 'nodeName' of null

Answer

Mouhamed Halloul picture Mouhamed Halloul · Jul 24, 2015

try surrounding your javascript with :

$( document ).ready(function() {
    var handlesSlider = document.getElementById('slidertest');

noUiSlider.create(handlesSlider, {
    start: [ 4000, 8000 ],
    range: {
        'min': [  2000 ],
        'max': [ 10000 ]
    }
});
});