90
rated 0 times
[
97]
[
7]
/ answers: 1 / hits: 26430
/ 12 Years ago, fri, april 6, 2012, 12:00:00
I'm trying to have a div's left property change by its self - one every second when your hovering over so I made this:
$(div.scroll_left).hover(function(){
var left_num = $('div.license_video').css(left)
var left_num1 = parseInt(left_num, 10) - 1;
var timerID = setInterval(alert(left_num1), 1000);
//var timerID = setInterval(slideleft(left_num1), 1000);
},function(){
clearInterval(timerID);
});
//function slideleft(left_num){
//$('.license_video').css('left', left_num + %);
//}
In theory you would think it repeat till you move your cursor off which clears the interval. When I hover over it does it one time and never repeats (there are no errors). Then when I hover off it gives a error Uncaught ReferenceError: timerID is not defined
More From » jquery