Skip to content

Instantly share code, notes, and snippets.

@jayd3e
Created August 19, 2014 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jayd3e/2eefbbc571cd1668544b to your computer and use it in GitHub Desktop.
Save jayd3e/2eefbbc571cd1668544b to your computer and use it in GitHub Desktop.
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