zonear / isotope-perfectmasonry

PerfectMasonry extension for Isotope
138 stars 49 forks source link

When the first element is larger than the following elements this doesn't work #1

Closed cameronkendall closed 11 years ago

cameronkendall commented 11 years ago

Tried using this but when the first element is larger (height and width) than the rest then this doesn't work.

mikkotikkanen commented 11 years ago

Could you be bit more specific as for example in this case (http://www.almamedia.fi/) it works just fine with double wide element in the beginning.

cameronkendall commented 11 years ago

In the example index.html code that you have in the project, if you just change the first div to have the class 'big' the rest of the formatting assumes they are all of that size so there are huge gaps.

mikkotikkanen commented 11 years ago

Ah, yeah. That's because that's the way isotope generally works: If no width is defined, it get's the size of the first tile and uses that as column width. If you want to have the first element in different size as the rest of them, you need to define the desired column width for isotope.

Like so:

$('#tiles').isotope({
    layoutMode: "perfectMasonry",
    perfectMasonry: {
        columnWidth: 200
    }
});