<div class="wrap">
<div class="block visible">1</div>
<div class="block">2</div>
<div class="block">3</div>
<div class="block">4</div>
<div class="block">5</div>
</div>
.block {
display: none;
}
.block.visible {
display: block;
}
function toggler(selector, delay) {
let elems = $(selector),
length = elems.length-1,
i = 0;
function toggleTo(index) {
elems.removeClass('visible');
$(elems[index]).addClass('visible');
}
setInterval(function(){
toggleTo(i === length ? i = 0 : ++i)
}, delay);
}
toggler('.block', 1000);
$(document).on('click', '.myBlock a', function(evt){
$(this).closest('.myBlock').remove(); // убираем блок
evt.preventDefault(); // отменяем переход
})