'jQuery animation works OK on JSfiddle, but does not on Wordpress (localhost Apache)

I try to run a jquery script, which works OK on jsfiddle, but when I move it to Wordpress it does not. I replaced "$" with "jquery" already, as I know the WP won't process $s.

The jsFiddle shows exactly how it suppose to act. After migrating this to WP, nothing happens on click. Do you have any ideas what can cause the issue?

jsfiddle here

jQuery(document).ready(function() {
  jQuery('.footbtn').click(function() {
    if (jQuery('.slideupmenu').hasClass('menuup')) {
      jQuery('.slideupmenu').addClass('menudown', 100, 'linear');
      jQuery('.slideupmenu').removeClass('menuup');
    } else {
      jQuery('.slideupmenu').removeClass('menudown');
      jQuery('.slideupmenu').addClass('menuup', 100, 'linear');
    }
  });

  jQuery('.x').click(function() {
    jQuery('.slideupmenu').addClass('menudown', 100, 'linear');
    jQuery('.slideupmenu').removeClass('menuup');
  });
});
.footbtn {
  z-index: 1000!important;
  padding: 30px;
  background: green;
  display: block;
  width: 20px;
  position: fixed;
  bottom: 0;
  right: 0;
}

.slideupmenu {
  position: fixed;
  width: 100%;
  height: 100%;
  background: yellow;
  bottom: -100%;
  z-index: 900!important;
}

.x {
  padding: 20px;
  width: 40px;
  background: yellow;
}

.menuup {
  bottom: 0px !important;
}

.menudown {
  bottom: -100% !important;
}

body {
  min-height: 1000px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<a href="#" class="footbtn">
    CLICK
    </a>

<div class="slideupmenu">
  <div class="x">
    X
  </div>

  <br />
  <br /> Line 1<br /> Line 2<br /> Line 3<br /> Line 4
</div>

I am struggling with this for a few hours now and just gave up. I also added local jquery file instead of the generic WP jquery. Still no joy. All libraries are loaded before the above code.

Thanks for any help.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source