Answer the question
In order to leave comments, you need to log in
How to overcome closestHandle is undefined?
I'm trying to implement this example
The site uses jquery 1.6.1
I have 2.1.4 (do not suggest another one)
The "slider" does not work
I get this in firebug:
TypeError: closestHandle is undefined
Code:
jQuery("#slider").slider({
/*min: 0,*/
/*max: 1000,*/
values: [0,1000],
range: true,
animate: true,
stop: function(event, ui) {
jQuery("input#minCost").val(jQuery("#slider").slider("values",0));
jQuery("input#maxCost").val(jQuery("#slider").slider("values",1));
},
slide: function(event, ui){
jQuery("input#minCost").val(jQuery("#slider").slider("values",0));
jQuery("input#maxCost").val(jQuery("#slider").slider("values",1));
}
});
jQuery("input#minCost").change(function(){
var value1=jQuery("input#minCost").val();
var value2=jQuery("input#maxCost").val();
if(parseInt(value1) > parseInt(value2)){
value1 = value2;
jQuery("input#minCost").val(value1);
}
jQuery("#slider").slider("values",0,value1);
});
jQuery("input#maxCost").change(function(){
var value1=jQuery("input#minCost").val();
var value2=jQuery("input#maxCost").val();
if (value2 > 1000) { value2 = 1000; jQuery("input#maxCost").val(1000)}
if(parseInt(value1) > parseInt(value2)){
value2 = value1;
jQuery("input#maxCost").val(value2);
}
jQuery("#slider").slider("values",1,value2);
});
// фильтрация ввода в поля
jQuery('input').keypress(function(event){
var key, keyChar;
if(!event) var event = window.event;
if (event.keyCode) key = event.keyCode;
else if(event.which) key = event.which;
if(key==null || key==0 || key==8 || key==13 || key==9 || key==46 || key==37 || key==39 ) return true;
keyChar=String.fromCharCode(key);
if(!/\d/.test(keyChar)) return false;
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question