admin管理员组文章数量:1346657
I made a couple of vertical scroll IntersectionObserver modules, but I'm interested in horizontal scroll (root will be a div and observation target will be an img). I want to observe the changes when the img bees enlarged but the div remains the width of the viewport. I'm not even sure that mobile Safari will report a zoomed img as having a changed width, this is an experiment. Back to the question though, I haven't found any info. re: observing horizontal intersection so I'm not sure if that's supported?
I made a couple of vertical scroll IntersectionObserver modules, but I'm interested in horizontal scroll (root will be a div and observation target will be an img). I want to observe the changes when the img bees enlarged but the div remains the width of the viewport. I'm not even sure that mobile Safari will report a zoomed img as having a changed width, this is an experiment. Back to the question though, I haven't found any info. re: observing horizontal intersection so I'm not sure if that's supported?
Share Improve this question asked Oct 9, 2019 at 18:19 Ted FitzpatrickTed Fitzpatrick 9441 gold badge9 silver badges20 bronze badges 2- 2 Intersection observers aren't inherently related to scrolling at all. They just observe how much of the element is inside the view port; whether that changed because of a horizontal or vertical scroll, a CSS change, or something else doesn't matter. – IceMetalPunk Commented Oct 9, 2019 at 18:32
- @IceMetalPunk ok so in your experience horizontal scroll is supported? – Ted Fitzpatrick Commented Oct 9, 2019 at 18:35
1 Answer
Reset to default 9To get an IntersectionObserver
only in the x axis you can add to the options: rootMargin: "4000px 0px 4000px 0px"
.
本文标签: javascriptDoes IntersectionObserver support horizontal scrolling observationStack Overflow
版权声明:本文标题:javascript - Does IntersectionObserver support horizontal scrolling observation? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743825151a2545503.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论