2

Possible Duplicate:
How I can stop vertical scroll by mouse.

I am using javascript/Jquery in web browser. I made a custom horizontal scroll bar which is working with mouse wheel or mouse scroll. Commonly mouse scroll works with vertical bar. So it conflicts with my programmed horizontal scroll bar. I don't want to remove vertical bar completely but just only to disable when we scroll our mouse. If you make sense then please suggest.

Community
  • 1
  • 1
Deepak
  • 1,055
  • 4
  • 13
  • 22
  • "scroll our mouse" You mean the scroll wheel? – epascarello Jul 08 '11 at 14:33
  • 2
    So there are horizontal and vertical scroll bars, but you want the wheel to scroll horizontally when the user is expecting it to scroll vertically? What about touch-pads and tilt-wheels that already scroll in both directions? – RobG Jul 08 '11 at 14:42
  • 1
    Did you search this on SO already, or is this not applicable to you? http://stackoverflow.com/questions/2032009/using-the-mouse-wheel-to-scroll-a-browser-window-horizontally – josh.trow Jul 08 '11 at 14:47
  • 1
    And this one...http://stackoverflow.com/q/2346958/446747 – josh.trow Jul 08 '11 at 14:48

1 Answers1

1
$('selector_for_your_container')
  .bind('mousewheel DOMMouseScroll', function(e) {
    e.preventDefault();
  });
jimbo
  • 11,004
  • 6
  • 29
  • 46