Created
July 15, 2016 06:45
-
-
Save Rachind/b0910b65a35b5d7f886643c0ecc76e4d to your computer and use it in GitHub Desktop.
Dynamically Adding HTML Elements to a Masonry Container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mediaItemContainer = $( '#container' ); | |
mediaItemContainer.masonry( { | |
columnWidth: '210px', | |
itemSelector: '.item' | |
} ); | |
$( mediaItemContainer ).prepend( '<div class="item">foo</div>' ); | |
$( mediaItemContainer ).masonry( 'reloadItems' ); | |
$( mediaItemContainer ).masonry( 'layout' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment