zonear / isotope-perfectmasonry

PerfectMasonry extension for Isotope
138 stars 49 forks source link

Anybody encounter "RangeError: invalid array length" error? #3

Closed lesterchan closed 11 years ago

lesterchan commented 11 years ago

RangeError: invalid array length Line 32: properties.grid = new Array(this.perfectMasonry.cols);

lesterchan commented 11 years ago

Looks like sometimes this.perfectMasonry.cols returns Infinity

I changed line 32 to

            // Create top row of the grid
            var cols = parseInt(this.perfectMasonry.cols, 10);
            if(!isNaN(cols) && cols > 0)
                properties.grid = new Array(cols);
            else
                properties.grid = new Array();
mikkotikkanen commented 11 years ago

Do you have any example where this happens? Also, are you using the latest isotope (since that looks more like a Isotope bug)?

lesterchan commented 11 years ago

I don't have an example yet as it is stil in development. I am using Isotope v1.5.21

mikkotikkanen commented 11 years ago

I meant the example that is provided with perfectmasonry. Does that work for you out from the box? I'd imagine it has something to do with css values (widths, floats etc) of the container and/or tiles. Keep deleting css rules from them until the layout works, then add things back until you find the culprit. :)

lesterchan commented 11 years ago

No worries man, I will figure it out. Closing this =)

mikkotikkanen commented 11 years ago

Cool. What was the problem?

lesterchan commented 11 years ago

Hey,

I am still figuring it out, but since my "small" fix work on the 2nd comment, I am keeping it for the time being till I have time to digg further =)