Created
May 4, 2021 21:57
-
-
Save asolera/a73d4ac56dde4e5e8075b4c6adfa92ba to your computer and use it in GitHub Desktop.
jQuery SlimScroll fix for window resize
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
function applySlimScroll() { | |
$('.slimScrollDiv .sidebar').unwrap(); | |
$('.slimScrollBar, .slimScrollRail').remove(); | |
$('.sidebar').slimScroll({ | |
height: 'auto', | |
size: '10px', | |
color: #ff0000', | |
alwaysVisible: true, | |
railVisible: true, | |
railColor: '#222', | |
railOpacity: 0.8 | |
}); | |
$(document).ready(function() { | |
applySlimScroll(); | |
$(window).resize(function() { | |
applySlimScroll(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment