Ecodev/natural-gallery-js

Natural.ts:25 Uncaught TypeError: Cannot read property 'rowHeight' of undefined

sahilshahane opened this issue · 2 comments

Hello i'm a beginner in JS and i've been trying to fix the problem but i'm not sure what's happening

window.addEventListener('load', function() {
var elementRef = document.getElementById('gallery');
var gallery = new NaturalGallery.Natural(elementRef); //Error on this line
var gallery.init();
});

I'm using Edge Browser [version : 81.0.416.68].
Error Image :
image

Hello sorry for delay, and for uncomplete docs. I'll fix that.

A minimum requirement for Natural format is the option rowHeight that determines the maximum height of a row. You should instantiate the library like this :

 var gallery = new NaturalGallery.Natural(elementRef, {rowHeight: 300});  // add option