I made a custom div scroller based on TweenMax easings and jQuery mousewheel events. The scroll works like a charm but I need to move the scrollbar handler to show the scroll progress. I made some tests based on calcs of parent width, scrollLeft and total div width, but didn't found the right solution…
I tried to adapt this example for my horizontal scrollbar, but it's still a strange behaviour.
Any idea?
$(window).on("mousewheel DOMMouseScroll", function (e) {
e.preventDefault();
var delta = e.originalEvent.wheelDelta / 120 /* Chrome */ || -e.originalEvent.detail; /* FF */
var dur = 1.2;
TweenLite.to($("#photos"), dur, {
scrollLeft: $("#photos").scrollLeft() - parseInt(delta * 35),
ease: Expo.easeOut,
overwrite: 5
});
});
Live example:
http://jsfiddle.net/tccsq6e9/2/