From 2b5737740988a21a68df0386f5e7f7f480d32da8 Mon Sep 17 00:00:00 2001 From: Hanzei Date: Wed, 11 Jul 2018 09:56:40 +0200 Subject: Prevent scrolling when modal is open Fixes #46 --- static/js/index.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'static') diff --git a/static/js/index.js b/static/js/index.js index 195ad57..08ef756 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -11,9 +11,11 @@ $('a[href^="#"]').click(function(e) { // Modal closer $('.card').click(function () { $($(this).attr('data-target')).addClass('is-active'); + $("html").addClass("modal-open"); }); $('.modal-close').click(function () { $($(this).attr('data-target')).removeClass('is-active'); + $("html").removeClass("modal-open"); }); $(document).keypress(function(e) { if(e.which == 0) { -- cgit v1.2.3