Skip to content

Instantly share code, notes, and snippets.

@giannwilk
Created November 20, 2013 18:55
Show Gist options
  • Save giannwilk/7568843 to your computer and use it in GitHub Desktop.
Save giannwilk/7568843 to your computer and use it in GitHub Desktop.
JavaScript: Lock Scroll Bar
// Lock Scroll
$('body').css('overflow','hidden');
$('body').attr('scroll','no');
// Unlock Scroll
$('body').css('overflow','auto');
$('body').attr('scroll','yes');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment