To remove masonry boxes with particular selector use this,
var remove=$('.sample'); // Use your removal class or ID here
msnry.remove(remove); // Attempting removal of the occurrences
msnry.reloadItems(); // Reload the layout
Pergunta
Using this syntax to load Masonry items:
var msnry = new Masonry( "#container-div",
{
columnWidth: 300,
gutter: 10,
isFitWidth: true,
isAnimates: true,
itemSelector: '.items',
animationOptions:
{
duration: 600
}
});
On click of a button or link I need to remove some items with .sample
or #sample
and this syntax does not works.
msnry.remove('.sample');
How to resolve?
Solução
To remove masonry boxes with particular selector use this,
var remove=$('.sample'); // Use your removal class or ID here
msnry.remove(remove); // Attempting removal of the occurrences
msnry.reloadItems(); // Reload the layout