Use JQuery for document height

Use JQuery to calculate document height to avoid issues reported by https://github.com/dimsemenov/Magnific-Popup/commit/e006448fab43d8836718837880be5002c88cbea1#commitcomment-3302509