Skip to content

Instantly share code, notes, and snippets.

@asolera
Created May 4, 2021 21:57
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 asolera/a73d4ac56dde4e5e8075b4c6adfa92ba to your computer and use it in GitHub Desktop.
Save asolera/a73d4ac56dde4e5e8075b4c6adfa92ba to your computer and use it in GitHub Desktop.
jQuery SlimScroll fix for window resize
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