iScroll 5 scrollbars and fade don't work together on iPhone
-
21-12-2019 - |
Question
I'm using iScroll 5 and I encountered a problem that occurs on iPhone 4 with iOS 5.1.1.
When using scrollbars = true and fadeScrollbars = true together - the iScroll is not working. http://jsfiddle.net/GuCC2/
myScroll = new IScroll('#wrapper', { scrollbars: true, fadeScrollbars: true });
The iScroll will work fine when fadeScrollbars = false: http://jsfiddle.net/GuCC2/2/
myScroll = new IScroll('#wrapper', { scrollbars: true, fadeScrollbars: false });
I was wondering if someone else had this problem and fixed it.
Thanks.
Solution
I realized that problem too, but I think there are not to many people around still using iOS 5. For a workaround you can fade the scrollbar manually:
$('.iScrollIndicator').css({opacity:'0'});
myScroll.on('beforeScrollStart', function() {
$('.iScrollIndicator').stop().animate({opacity:'100'});
});
myScroll.on('scrollCancel', function() {
$('.iScrollIndicator').animate({opacity:'0'});
});
myScroll.on('scrollEnd', function() {
$('.iScrollIndicator').animate({opacity:'0'});
});
Updated fiddle http://jsfiddle.net/GuCC2/3/
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow