Recent Codepen issues with js/jquery/bootstrap

I recently had issues concerning jquery and codepen. Most of them i resolved myself. One of them is about smoothscrolling. It works fine in local and on, but on codepen works every other tuesday … Did anyone had situations where some jquery/bootstrap/js code worked fine before, then after some time just stopped and/or acted finicky?

PS: I used this standard snippet for smoothscrolling whom you can find everywhere online:

$("#navbar a").on("click", function(event) {
    if (this.hash !== "") {

      hash = this.hash;

      $("html, body").animate(
          scrollTop: $(hash).offset().top
        function() {
          window.location.hash = hash;