for example, there is a very regular layout on the mobile end, with fixed top and bottom, with more than one screen of scrolling content in the middle.
generally speaking, for pages with this structure, there are usually two layout methods
(1) considering that the mobile phone does not support fixed very well, you can wrap an outer container with 100% width and height in the outermost layer, and fix the top floor on the top and bottom respectively with abusolute inside, and the middle content is 100% wide and high. Use padding to set aside the top and bottom positions, and overflow:scroll can be used.
(2) the other is to use overflow:hidden;
in the middle content area, and then use js to record the scrolling area of the finger, and then dynamically change the Y value of translate3d.
I would like to ask seniors, from the point of view of the solution, the second is obviously more complex than the first, so why do many websites choose the second solution instead? Is there anything wrong with the first plan?
Thank you in advance ~