Created
August 19, 2014 00:53
-
-
Save jayd3e/2eefbbc571cd1668544b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
disable_scroll: function() { | |
/* if scrolling is even possible */ | |
if ($(document).height() > $(window).height()) { | |
var scrollTop = (this.html_el.scrollTop()) ? this.html_el.scrollTop() : this.body_el.scrollTop(); // Works for Chrome, Firefox, IE... | |
if (scrollTop < 0) { scrollTop = 0; } | |
$('html').addClass('is-unscrollable').css('top', -scrollTop); | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment