$('.next').click(function(){ var markerClick = true; if(markerClick == true) { sliderNext(); markerClick = false; } });