Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.9k views
in Technique[技术] by (71.8m points)

ios滑动穿透问题?外边页面,弹窗里边均可滚动?

image.png
ios滑动穿透问题?外边页面,弹窗里边均可滚动?在弹窗里边滑动会影响到底层页面这种情况怎么修改?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

借机科普一个 CSS 新属性 overscroll-behavior: contain; 正是用来处理滚动越界行为的。

https://caniuse.com/?search=o...
https://developer.mozilla.org...

嗯,Android Chrome 新版已经支持了,可惜 iOS 目前还不支持,你可以加一小段 js 做 polyfill, scroll 的时候判断如果到两端了就 preventDefault, 不难。

demo: https://mdn.github.io/css-exa...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...