How to scroll through a div by dragging and not by using the scroll bars
问题 I am working on a project that uses a touch-screen interface. I have a div inside of a smaller div, so the smaller div has scroll bars to access the rest of the first div. Here is the basic code for it. .div1{ height: 100px; width: 100px; } .div2{ height: 50px; width: 50px; } and the html is: <div id = "div2" class="div2"> <div id="div1" class="div1"></div> </div> Using javascript, I would like to be able to scroll through div2 by pressing (since it is a touch screen) an unoccupied part of