本文介绍了如何删除所有图像并添加新的图像列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用Isotope插件删除当前存在的所有图像并按一下按钮加载到一组图像中?
Using the Isotope plugin how can I remove all images that currently exist and load in a set of images on a press of a button?
在文档中说这样做是为了删除单个项目:
In the documentation it says do this to remove a single item:
.isotope( 'remove', $items, callback )
如何删除所有项目,然后加载一组新项目? jsfiddle中的一个示例将是很棒的.
How can I remove all the items and then load a new set of items? An example in jsfiddle would be wonderful.
推荐答案
我最近也需要用一组新的图像替换所有同位素.
I, too, recently needed to replace all isotope items with a new set of images.
这对我有用:
var $isoContainer = $('#image-feed');
$isoContainer.isotope('remove', $isoContainer.isotope('getItemElements'));
$isoContainer.isotope('appended', $newEntries);
$isoContainer.isotope('layout');
这篇关于如何删除所有图像并添加新的图像列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!