简体   繁体   English

无限滚动隐藏第一个元素

[英]infinite scroll hide first elements

I'm using a infinite scroll and I would like hide content (50 first div elements) when user loaded 300 elements... 我正在使用无限滚动,当用户加载300个元素时,我想隐藏内容(50个第一个div元素)...

Example : user is currently on 250 - 290 element with scroll My goal : hide 0 - 50 element part 示例:用户当前在使用滚动的250-290元素上我的目标:隐藏0-50元素部分

I tried to understand this algo from Mutahhir but there is a lack of code. 我试图从Mutahhir理解这种算法,但是缺少代码。

Performance with infinite scroll or a lot of dom elements? 使用无限滚动或许多dom元素进行演奏?

Thx 谢谢

Try this css on your elements: 在您的元素上尝试以下CSS:

.yourelement:nth-child(-n+50){
    display:none;
}

I think you can set the .yourelement name in the itemSelector property of the plugin. 我认为您可以在插件的itemSelector属性中设置.yourelement名称。

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

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