I have a function, that is called by interval function, as well on click on a link, my link will clear the interval, and call the same function again.
calling this types will do the different work, but i don't know how to find, whether my interval function is calling my function or onclick function calling my function..
How can i find the caller of my function?
This is my function
function slideshow (){
$('#slide_viewer ul').css({marginLeft : -(slideWidth * currentSlide)+'px'});
if(currentSlide == (totalSlides-1)){
currentSlide = 0;
}else{
currentSlide++;
}
}
var myInterval = setInterval(slideshow,3000);
$('a.control').click(function(){
currentSlide = ($(this).attr('id') == "prev") ? (currentSlide = currentSlide-1) : (currentSlide = currentSlide+1);
slideshow ();
})