Image carousel with jQuery 3.3.1
I like it.

There are only a few things I would reconsider:


detectedId is a clunky name, clickedId or selectedId seems better
You hardcode 4, at least use a constant, ideally detect how many buttons there dynamically
The treatment for the first button is different enough that it can be placed outside of the loop
It seems you only need to know which button was clicked, which can be found by analyzing the selected id

if(selectedId === "btn1"){
  $(".cont-img div").css("left", "0%");
}else{
  let id = selectedId.split('btn')[1]*1;
  $(".cont-img div").css("left", "-" + (id - 1) + "00%");
}



This way you dont even need to hardcode 4