Difference between revisions of "Template:Marburg/scripts.js"

 
(6 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
     $("head").append('<meta name="viewport" content="width=device-width, initial-scale=1">');
 
     $("head").append('<meta name="viewport" content="width=device-width, initial-scale=1">');
 
     var showMenu = !1, burger = document.getElementById("burger");
 
     var showMenu = !1, burger = document.getElementById("burger");
     function popup(e, nofix) {
+
     function popup(e) {
 
       $("#" + e).css("display", "block");
 
       $("#" + e).css("display", "block");
      if (!nofix) {
 
        $("header").css("top", "15px");
 
        $(".main").css("margin-top", "15px");
 
      }
 
 
       location.hash = "#" + e;
 
       location.hash = "#" + e;
 +
      $(document).keyup(function(evt) {
 +
        if (evt.keyCode === 27) {
 +
          hide(e);
 +
        }
 +
      });
 
     }
 
     }
 
     function hide(e) {
 
     function hide(e) {
Line 26: Line 27:
 
         return;
 
         return;
 
       }
 
       }
       popup(hash, true)
+
       popup(hash)
 
     }
 
     }
 
   </script>
 
   </script>
 
</html>
 
</html>

Latest revision as of 20:23, 13 December 2019