|
Deleting a variable
So I have a slider, I want to call a function to control speed, now it works if I pick a higher number, but it won't delete the previous variable and continues to call the function over and over (highlighted in red).
<code>
$(function() {
$( "#slider" ).slider({
orientation: "horizontal",
range: 1000,
max: 20000,
min:1000,
value: 5000,
slide: function(event, ui) {
// myInt=setInterval(runPHPScript, (((ui.value/1000).toFixed(0))*1000));
$("#slider_value").val((ui.value/1000).toFixed(0));
}
,
stop: function(event, ui) {
delete myInt;
var myInt = setInterval(runPHPScript, ui.value);
},
change: function(event, ui) {
myInt=setInterval(runPHPScript, (((ui.value/1000).toFixed(0))*1000));
$("#slider_value").val((ui.value/1000).toFixed(0));
}
});</code>
Last edited by dawg; 08-17-2012 at 06:11 AM..
|