Currently I'm using the default Jquery slider to change values within a map in jVectormap, but due to limited styling options I'm forced to switch to another slider. Here's the code of the working Jquery slider:
$(".slider").slider({
value: val,
min: 2002,
max: 2012,
step: 1,
slide: function( event, ui ) {
val = ui.value;
mapObject.series.regions[0].setValues(data.states[ui.value]);
checkData(val);
}
});
Now I found a different slider (ionRangeSlider: http://www.spicyjquery.com/demo,34.html) that perfectly fits my needs, but it doesn't work the same as the default Jquery slider, thus it loses functionality. Here's the code of ionRangeSlider:
$("#ion_slider").ionRangeSlider({
value: val,
min: 2002,
max: 2012,
step: 1,
type: 'single',
hasGrid: true
});
To change values on slide with ionRangeSlider I should use the onChange function according to the slider's documentation:
// callback is called on every slider change
onChange: function (obj) {
console.log(obj);
}
So what I want to do now, is to use the ionRangeSlider to change values on the jVectormap. My interpretation would be something like:
$("#ion_slider").ionRangeSlider({
value: val,
min: 2002,
max: 2012,
step: 1,
type: 'single',
hasGrid: true,
// callback is called on every slider change
onChange: function ( event, ui ) {
val = ui.value;
mapObject.series.regions[0].setValues(data.states[ui.value]);
checkData(val);
}
});
But - ofcourse - it's returning an error that ui is undefined.

My guess is that it has to do with Jquery UI, yet it is included in the page:

Anyone that has an idea on how to get around this? Sorry I'm totally new to this.
uiis not jQuery ui. It is the second parameter passed to youronChangefunction. Read the documentation, and find out what it is.