You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have one quick question, how would I add multiple masonry grids (each with its own set of rules.. gutter, width etc..) and one thing,, I can only use one class (for ex. .masonry) but I guess I need to document.querySelectorAll('.masonry') iterate each node right?
Thanks
The text was updated successfully, but these errors were encountered:
Ok, got it,, I've found solution to have multiple instances just by having same class starting with .masonry[XX] and easily hook that to DOM loaded evt and all sparky now :) Please close this as it's fixed now
var arr = document.querySelectorAll( '[class^="masonry"]' ) ;
if( arr.length ){
for (var i = arr.length - 1; i >= 0; i--) {
var data = JSON.parse( arr[i].dataset.mason );
var masonry = new MiniMasonry({
container: '.' + arr[i].classList[0],
baseWidth: parseInt( data.width ),
gutter: parseInt( data.gap )
});
}
}
Hi,
thank you for your little and great library..
I have one quick question, how would I add multiple masonry grids (each with its own set of rules.. gutter, width etc..) and one thing,, I can only use one class (for ex. .masonry) but I guess I need to
document.querySelectorAll('.masonry')
iterate each node right?Thanks
The text was updated successfully, but these errors were encountered: