How can i update variable from function? I have this. But both variables still "0" after "updateFilter()". How can i do this without run "loadAjax(var1, var2)" from slider function?
var var1 = 0,
var2 = 0;
$("#slider").slider({
// options...
stop: function( event, ui ) {
var var1 = ui.values[ 0 ], // <- changes on move
var2 = ui.values[ 1 ]; // <- changes on move
updateFilter();
}
});
function updateFilter() {
loadAjax(var1, var2);
}
sorry for my english