-
-
Save POMXARK/ef01be7117f26d3c5022a209e01fa92b to your computer and use it in GitHub Desktop.
Prevent body scroll while scrolling sidebar
This file contains hidden or 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
| var body = document.getElementsByTagName('body')[0], | |
| sidebar = document.getElementById('sidebar'); | |
| // sidebar overflow hide | |
| sidebar.onmouseover = function() { | |
| body.style.overflow = 'hidden'; | |
| } | |
| sidebar.onmouseout = function() { | |
| body.style.overflow = 'auto'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment