I have been working on this animated horizontal offset for div, on mousescroll
event.
Here is the link for what I've done till now, could somebody see what I'm doing wrong?
The animation happens on the click action i need the same for mousescroll. http://jsfiddle.net/laksdesign/WvRR6/
jQuery(document).ready(function($) {
$(".scroll").click(function(event) {
event.preventDefault();
$('#wrapper').animate({ scrollLeft: $('#wrapper').scrollLeft() + $(this.hash).offset().left }, 800);
});
$('body').bind('mousewheel', function(scroll){
if(scroll.originalEvent.wheelDelta /120 > 0) {
scroll.preventDefault();
$('#wrapper').animate({ scrollLeft: $('#wrapper').scrollLeft() + $(this.hash).offset().left }, 800);
} else{
}
});
});
There is another reference which I took the animation based on mousescroll is: http://jsfiddle.net/laksdesign/EATaU/