title: 'top' of undefined or null reference
body: <p>'onscroll' class not added to edge and internet explorer This two browser show an error top is undefined or null referance. It works fine on all other browser including chrome, firefox and safari.</p>
  
  <pre><code>    var s = $(".lgx-header-position");
      var pos = s.position();
  
      $(window).on('scroll', function () {
          var windowpos = $(window).scrollTop();
          if (windowpos &gt;= pos.top) {
              s.addClass("menu-onscroll");
          } else {
              s.removeClass("menu-onscroll");
          }
      });
  </code></pre>