Skip to content

Instantly share code, notes, and snippets.

@trangsihung
Last active March 8, 2019 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trangsihung/50f36593b338af4e903d2bfc753d2594 to your computer and use it in GitHub Desktop.
Save trangsihung/50f36593b338af4e903d2bfc753d2594 to your computer and use it in GitHub Desktop.
reset masonry after ajax called
document.addEventListener('contextmenu', event => event.preventDefault());
$('.grid').masonry({
itemSelector: '.grid-item',
columnWidth: '30',
});
// after append data
$('.grid').append(data).each(function() {
$('.grid').masonry('reloadItems');
});
$('.grid').masonry();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment