title: jQuery cannot read property closest of null
body: <p>I am using the same script on all pages but it fails on just one. The error log states "cannot read property closest of null" and highlights the very first line. Cannot see any reason why it would work on all pages bar one so would be grateful if anyone could shed some light on this issue?</p>
  
  <pre><code>$("ul.menu").closest(".dropdown_fullwidth").add('ul.menu li').add('ul.nav-shop').mouseenter(function () {
      $("#nav-blackout").css("display", "block");
  })
      $("ul.menu").mouseleave(function () {
      $("#nav-blackout").css("display", "none");
  });
      $("ul.menu").mouseenter(function () {
      $("ul.nav-shop li:nth-child(1)").addClass("is-active");
      $("li.is-active a").next(".has-product-noms").addClass("display-product-noms"); 
      if ($(".display-product-noms")[0]){
      $(".nav-banner").css("right", "0");
  } else {
      $(".nav-banner").css("right", "9999em");
  }
  })
      $("ul.menu").mouseleave(function () {
      $("ul.nav-shop li:nth-child(1)").addClass("is-active");
      $("li.is-active a").next(".has-product-noms").addClass("display-product-noms"); 
  });
      $("li.nav-shop-sub").mouseenter(function () {
      $("li.nav-shop-sub .is-active").removeClass("is-active");
      $(this).addClass("is-active");
      $("li.is-active a").next(".has-product-noms").addClass("display-product-noms");
      if ($(".display-product-noms")[0]){
      $(".nav-banner").css("right", "0");
  } else {
      $(".nav-banner").css("right", "9999em");
  }
      $("#nav-blackout").css("display", "block");
  })
      $("li.nav-shop-sub").mouseleave(function () {
      $("li.is-active a").next(".has-product-noms").removeClass("display-product-noms");
      $(this).removeClass("is-active");
      $("#nav-blackout").css("display", "none");
  });
      $(".menu").tinyNav();
  });
  </code></pre>