I'm using this set interval function:
function ticker(){
setInterval(function(){
$('.slide').fadeToggle();
}, 5000);
}
What I want to do is that when the user clicks on a div
with onclick="topbartoggle"
the setInterval
function stops, and if he clicks again on it the setInterval
function begins to work again:
function topbartoggle(){
$('#top-bar').toggleClass('active');
$('.top-bar-box').slideToggle();
$('.top-bar-close').fadeToggle();
}
Any idea on how to do this?