2

I would like to prevent horizontal scrolling on my site using the multitouch trackpad on Macbooks, magical mouse etc. This issue is solved for Firefox (using solution from here: Prevent horizontal touch pad scrolling on macbooks using Firefox?). But it still gives me trouble on Chrome.

Is there any way of preventing this functionality on Chrome (e.g. using eventlistener)? Thanks

Community
  • 1
  • 1
user1160636
  • 121
  • 3
  • Check out http://stackoverflow.com/questions/8737709/any-way-to-prevent-horizontal-scrolling-triggering-swipe-back-gesture-on-os-x-li – Jonathan Jan 20 '12 at 13:00

2 Answers2

1

I had the same problem, and setting overflow to hidden in the CSS did not work too. My solution was using:

jQuery('html, body').css('overflow-x', 'hidden');

I dont know why, but in JavaScript it works.

Alexander
  • 23,432
  • 11
  • 63
  • 73
grogers
  • 85
  • 1
  • 8
0

In CSS, you can use overflow-x: hidden; to prevent scrolling. If you apply it to the body, or another element specifically that should do the trick.

Alexander
  • 23,432
  • 11
  • 63
  • 73
adam8810
  • 721
  • 1
  • 7
  • 22