I have this script and need to be able to call the $play variable as a function i.e. restart the set interval the pause function works fine but I can’t get it to restart on clicking play.
if( itemsCount > 1 ) {
// addNavigation
var $navPlay= $('body').find('.play'),
$navPause= $('body').find('.pause'),
$imgWrapper= $rgGallery.find('div.rg-image'),
$play = window.setInterval(function(){
_navigate('right');
}, 500);
$navPlay.on('click', function( event ) {
$play;
return false;
});
$navPause.on('click', function( event ) {
clearInterval($play);
return false;
});
}
},
Haven’t exactly had the time to create an example to replicate something similar to your use case, but something along these lines should do.