0

My page has a horizontal scroll feature, and when a button is pressed the DIV containing the scrolling content animates to the left.

The width of that element is 18000px, so it has a horizontal scrollbar that I disabled.

However I could still drag my page left and right and I would like to stop users doing that. Is there a css solution to my problem? Thanks for your time

user2751288
  • 188
  • 1
  • 17

2 Answers2

0

I suppose using overflow:hidden on the DIV and use javascript to control the margin-left to shift left and right will do the job

Edit Add example:

<!-- The "Frame" -->
<div class="container" style="width:1024px;overflow:hidden">
  <div class="very-long-div" style="width:18000px">
     Your awesome content here
  </div>
</div>
Jason Leung
  • 3,819
  • 3
  • 16
  • 10
0

In your CSS, hide the horizontal scrollbar by doing body{overflow-x:hidden;}.

kamoroso94
  • 1,713
  • 1
  • 16
  • 19