title: $(window).scroll not firing
body: <p>I am using Sharepoint developper. Inside the page I have custom JQuery code which works fine. But when I add the $(window).scroll it does not fire.</p>
  
  <pre><code>function TTNListScroll()
  {
  var bestaatDiv = document.getElementById("header-fixed");
  if(bestaatDiv ==null){
      alert("mag maar 1 keer komen");
      var head = document.getElementsByTagName("thead");
      TTNmyTable = head[0].parentNode;
      TTNmyTable.id="table-1";
      var parent = TTNmyTable.parentNode;
      parent.removeChild(TTNmyTable);
      parent.appendChild(TTNmyTable);
      var newTable=document.createElement("table");
      newTable.id="header-fixed";
      parent.appendChild(newTable);
  
      var tableOffset = $("#table-1").offset().top;
      var $header = $("#table-1 &gt; thead").clone();
      var $fixedHeader = $("#header-fixed").append($header);
      $(window).scroll(function() {
      alert('a');
      });
      alert($._data(window).events.scroll);
      alert($(window).height());
      }
  }
  </code></pre>
  
  <p>The function is defined inside the document.ready 
  My goal is to freeze a table header when i scroll down.</p>
  
  <p>If anybody has any ideas they are well appreciated.</p>
  
  <p>Thanks</p>