This problem seems quite strange , I checked for replacement for my code but all of them give the same problem . One replacement can be Jquery: mousedown effect (while left click is held down) . I am trying to make a slider that will slide the thumbs of images to right or left . From the thumbs the person can then choose and click the image he wants and it will get displayed .The thumbs can slide to both right and left . The problem is that after clicking the right button the images don't slide again towards left , I think it is something with clearinterval . Here is the fiddle , http://jsfiddle.net/2rfm5/18/ After clicking the right arrow the left sliding effect wont work .
$("#popUpInnerArrowLeft").mousedown(function(event) {
movetoleft();
});
var into ,into2 ;
function movetoleft() {
function moveit() {
$(".thumbsInnerContainer").animate({right:'+=10px'});
}
into = setInterval(function() { moveit(); }, 500);
}
$(document).mouseup(function(event) {
clearInterval(into);
});
//for the right arrow
$("#popUpInnerArrowRight").mousedown(function(event) {
movetoright();
});
function movetoright() {
function moveit2() {
$(".thumbsInnerContainer").animate({left:'+=10px'});
}
into2 = setInterval(function() { moveit2(); }, 500);
}
$(document).mouseup(function(event) {
clearInterval(into2);
});