Here is working example of horizontal scroll with mousewheel, but it do not scroll smoothly, like ordinary vertical scroll in Firefox or Opera.
$(function() {
$("html, body").mousewheel(function(event, delta) {
this.scrollLeft -= (delta * 30);
event.preventDefault();
});
});
(http://brandonaaron.net/code/mousewheel/docs)
I've made the live demo to show you how it's occur. http://jsfiddle.net/Dw4Aj/
I want this scroll to work like the vertical one. Both with mousewheel and smoothness. Can someone help me?
I'm just going to leave this here.
http://jsfiddle.net/Dw4Aj/19/
Try to use your function in conjunction with .animate()
I just actually did this myself and it works. I created an instagram feed on the web application that I created, and the other plugins that I was using were breaking all too often:
I found other nice solution - to use wrapper, so you scroll absolute to same position as you would to scroll vertical, it works if you just need scroll, no text selection or other(may be can work arounded, but i tired)
http://jsfiddle.net/oceog/Dw4Aj/16/
i made another sample, now without wholescreen wrapper, and possibility to select http://jsfiddle.net/oceog/DcyWD/
Just change this:
to this:
1st i think about it is to remember last scroll event timestamp, play with easing function, to get good result http://jsfiddle.net/oceog/Dw4Aj/13/
Smooth scrolling is a browser specific feature.
If you want something that works on all of them then you need to do it on your side. There are multiple implementations of smooth scrolling for jQuery.
And actually you may even need so called kinetic scrolling. If so try jquery.kinetic