I'm trying to adjust Bootstrap carousel to work on mousewheel. So far the jQuery looks like this:
$('#thumbnailCarousel').bind('mousewheel', function(e){
$(this).carousel('next');
});
$('#thumbnailCarousel').mouseover(function() {
$('body').css('overflow-y','hidden');
});
$('#thumbnailCarousel').mouseleave(function() {
$('body').css('overflow-y','scroll');
});
The first part makes the gallery scrollable with mousewheel. The problem was that the body was scrolling at the same time, so I gave it "overflow-y: hidden" on mouseover.
It's almost what I want now, except that with overflow:hidden the scrollbar obviously dissapears and the layout jumps to the right. It's really ugly, so is there any way I can prevent the body from scrolling while keeping the scrollbar in place?