0

I made a one-page website with parallax scrolling, and background images of 1920x1080px.

I added overflow-x: hidden; in the body (in the stylesheet). The horizontal scrollbar dissapeard, wich is good, but users can still scroll horizontaly with their middle mouse button. I don't want that and don't know how to disable it. I googled for like 1-1.5 hours, but the only thing I found was the overflow-x: hidden; wich does not DISABLE the scrolling.

If anyone knows a solution for this problem, please tell me.

Thank you,

Jordi B.

Jordi
  • 156
  • 1
  • 18
  • I would rather mark your question as a duplicate to this question: http://stackoverflow.com/questions/18640274/how-can-i-stop-users-from-dragging-a-page-horizontally, but it is still a duplicate. – VisioN Jun 09 '14 at 13:05
  • 1
    body { overflow-x: hidden; } – Ankit Agrawal Jun 09 '14 at 13:10

1 Answers1

0

Its because some divisions are extending beyond the page. Check the divisions by giving them a background color. And look for the one extended more.

Varun
  • 860
  • 2
  • 10
  • 26
  • how can i know what division over extends, they are all 1920 wide, and my laptop's screen is 1366, it is for every screen different, how would I make it so the division fit the screen perfectly, maybe that is a solution – Jordi Jun 09 '14 at 13:13
  • try opening the page in firefox and press your right arrow button. The page may move to right. – Varun Jun 09 '14 at 13:16
  • does it need to be in firefox? or can i try it in chrome to? i can't move horizontaly with my arrow keys in chrome – Jordi Jun 09 '14 at 13:19
  • that's what I thought. It happened to me. Try in firefox – Varun Jun 09 '14 at 13:20
  • ok i'l install firefox and try it, hang in there :) thank you for your help – Jordi Jun 09 '14 at 13:21
  • yup, i can move to the right with my arrows in mozilla firefox – Jordi Jun 09 '14 at 13:23
  • what do i need to do to prevent that? the users of the side must be unable to scroll horizontaly – Jordi Jun 09 '14 at 13:26
  • find what causes the problem. or try setting the width of the division like 95% something like that. – Varun Jun 09 '14 at 13:28