简体   繁体   English

JavaScript同位素-如何管理动态数据集(重新初始化同位素)

[英]JavaScript Isotope- How to manage dynamic data set (re-initialize Isotope)

I want to design a website which shows the simple search results with Isotope appearance. 我想设计一个网站,该网站显示具有Isotope外观的简单搜索结果。 I have a text input and get the query from the user and retrieve the search results from my server. 我有一个文本输入,并从用户那里获取查询,并从我的服务器上检索搜索结果。 So, by changing the query, my data and filtering options change. 因此,通过更改查询,我的数据和过滤选项也会更改。 I don't know how to manage this dynamic data with Isotope . 我不知道如何使用Isotope管理这种动态数据。

After each query and data change, when I set the new isotope properties and filters in $container.isotope , the data blocks become invisible and Isotope functions, like animation and filtering, didn't work anymore. 在每次查询和数据更改之后,当我在$container.isotope设置新的同位素属性和过滤器时,数据块变得不可见,并且Isotope功能(例如动画和过滤)不再起作用。

Does anybody know how to manage dynamic data set with Isotope? 有人知道如何使用同位素管理动态数据集吗? And how to re-set (re-initialize) Isotope settings after changing of the data set (data blocks)? 以及在更改数据集(数据块)后如何重新设置(重新初始化)同位素设置?

Thanks in advance. 提前致谢。

I found the answer myself! 我自己找到了答案! We can use insert and remove function of Isotope. 我们可以使用同位素的插入和删除功能。 http://isotope.metafizzy.co/docs/adding-items.html http://isotope.metafizzy.co/docs/adding-items.html

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

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