简体   繁体   English

如何使用无限滚动链接页面上的元素?

[英]How to link an element on a page with Infinite Scroll?

I have a page that contains a container with infinite scroll that loads articles. 我有一个页面,其中包含一个带有无限滚动的容器,用于加载文章。

The question is, how can I link a specific article, when its div isn't loaded into the DOM until you start scrolling? 问题是,当直到开始滚动时才将其div加载到DOM中时,如何链接特定文章?

I want the link to point to an id of the div that is loaded using infinite scroll. 我希望链接指向使用无限滚动加载的divid

Unfortunately, nothing I did worked so far. 不幸的是,到目前为止我什么都没做。

If the element is not yet in the HTML of the page, you will not be able to directly link to it. 如果该元素尚未出现在页面的HTML中,则将无法直接链接到该元素。 You will have to find an alternative solution, maybe something like using JavaScript interaction that loads more pages until it finds the desired article. 您将不得不找到替代解决方案,例如使用JavaScript交互来加载更多页面,直到找到所需的文章为止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM