I’m using isotope.js to display images in a simple cms, and when an image is deleted it removes the image from the list i’m calling the reLayout method:
$('.item').on('click',function(){
$(this).remove();
$('ul').isotope( 'reLayout' );
});
This works for every single item except the first item in the list.
I’ve replicated the issue here:
Can anyone help me out here? I can’t figure it out for the life of me!
Ok, i figured it out. There is a remove method in isotope that does what i was doing manually. All’s well that ends well. Here’s the documentation for you future people who might need it:
http://isotope.metafizzy.co/docs/methods.html#remove