What are the advantages and disadvantages of these two layout methods?

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 ~

Mar.03,2021

Ah, is there a difference between the two?
personally, I think it's better to distinguish what to do in the scrolling area in the middle. overflow:scroll has a bad side effect is that there may be some performance problems, and you also need to work with the webkit attribute, but if you use js to simulate scrolling, then this problem does not exist, and there are ready-made wheels to use, so maybe a simpler need will go directly to js with a more complex scroll+webkit,. The layout of
is actually simple. Generally, both header and footer are fixed heights, and the middle is filled with calc (100vh-set height and sum) , and relative positioning can be done.

Menu