最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

typescript - If I pass a NodeListOf<HTMLElement> to the Motion's InView function, is an Intersection Obser

programmeradmin2浏览0评论

I am working with Motion's InView function to detect different elements within the ViewPort, so I am currently giving it a NodeListOf.

When I do this, it creates a general Intersection Observer, one for each element in my NodeListOf or how does it work?

This is a segment of what I am doing:

export function cardsInView(cards: NodeListOf<HTMLElement>, indexLinks: NodeListOf<HTMLAnchorElement>) {
    inView(cards, (info) => {
    ...

I have this question to know if it is a better idea to pass each element with a forEach or leave it this way.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论