Fix div to bottom without using css position

后端 未结 2 2021
悲哀的现实
悲哀的现实 2021-02-10 02:01

I am having issues with position: fixed; on IOS8 Safari. I\'ve determined it\'s related to the footer div which I am positioning at the bottom of the page. I\'ve al

2条回答
  •  抹茶落季
    2021-02-10 02:41

    iOS has issues with fixed positioning. When swiping to scroll, it will not update the fixed position until the tap/drag is released.

    While position: fixed; technically works, mobile Safari does not redraw the fixed element while the scroll is happening in order to properly calculate the over-scroll animation (dragging and releasing causes the page to keep scrolling based on the speed of the swipe), so it won't update until the animation has stopped.

    You could, theoretically, use JavaScript to manually update the element's position a bunch of times while dragging occurs, but that will override the default, natural behavior of mobile Safari.

    More reading material and examples, if you're interested: http://remysharp.com/2012/05/24/issues-with-position-fixed-scrolling-on-ios

提交回复
热议问题