title: Uncaught TypeError: $ is not a function / body.getScroll is not a function
body: <p>I had a working website based on Joomla 3.9.2. But after installing a new component, the below function started to return the error <strong>"Uncaught TypeError: $ is not a function"</strong> at line <strong>"var body = $(document.body);"</strong>.</p>
  
  <pre class="lang-js prettyprint-override"><code>((function() {
    var scrollingHeader = function() {
      var body = $(document.body);
      var scroll = body.getScroll();
      if (scroll.y &gt; 0 &amp;&amp; body.id !== 'rt-offline' &amp;&amp; body.id !== 'rt-comingsoon') body.addClass('scrolling-enable');
      if (scroll.y == 0 &amp;&amp; body.hasClass('scrolling-enable')) body.removeClass('scrolling-enable');
    };
    window.addEvent('scroll', scrollingHeader);
  })());
  </code></pre>
  
  
  
  <p>Searching the Internet I see many posts that the <strong>noConflict</strong> removes the association between $ and jQuery. Indeed I have these lines in my page source, where there is <strong>noConflict</strong> is included: </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;script src="/media/jui/js/jquery.min.js?941b0fb0b53669f1c7ae375ee879339b" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/media/jui/js/jquery-noconflict.js?941b0fb0b53669f1c7ae375ee879339b" type="text/javascript"&gt;&lt;/script&gt;
  ..
  &lt;script src="/media/system/js/mootools-core.js?941b0fb0b53669f1c7ae375ee879339b" type="text/javascript"&gt;&lt;/script&gt;
  ..
  &lt;script src="/templates/rt_paradigm/js/scrolling-header.js" type="text/javascript"&gt;&lt;/script&gt;
  ..
  </code></pre>
  
  
  
  <p>Therefore, I changed the error generating line:
  <strong>"var body = $(document.body);"</strong>
  to this: 
  <strong>"var body = jQuery(document.body);"</strong>
  But now I get another error:
  <strong>Uncaught TypeError: body.getScroll is not a function</strong>
  on the line:
  <strong>var scroll = body.getScroll();</strong></p>
  
  <p>So, anyone know how can I resolve the conflict?..</p>
  
  <p>Thanks!</p>