Skip to content Skip to sidebar Skip to footer

How Can I Stop Users From Dragging A Page Horizontally?

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

Solution 1:

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" --><divclass="container"style="width:1024px;overflow:hidden"><divclass="very-long-div"style="width:18000px">
     Your awesome content here
  </div></div>

Solution 2:

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

Post a Comment for "How Can I Stop Users From Dragging A Page Horizontally?"