bigbite / macy.js

http://macyjs.com/
MIT License
1.3k stars 156 forks source link

NodeElement container #51

Closed electerious closed 5 years ago

electerious commented 5 years ago

Is it correct that the container option only allows a selector, but no NodeElement?

I would like to create a Macy instances for multiple elements without using a id.

document.querySelectorAll('.masonry').forEach((elem) => {

    const macy = Macy({
        container: elem,
        trueOrder: false,
        waitForImages: false,
        margin: 24,
        columns: 6,
        breakAt: {
            1200: 5,
            940: 3,
            520: 2,
            400: 1
        }
    })

})
sjankowski commented 5 years ago

I got the same problem. Have You discovered something about that @electerious ? Even when using class selector - only first child is working.

sjankowski commented 5 years ago

@electerious i found a workaround in one of closed issues: https://github.com/bigbite/macy.js/issues/34#issuecomment-337539077

Hope it will help You too :)

jrmd commented 5 years ago

Hi @sjankowski and @electerious

As this seems to be a highly requested feature, I will work to implement for the next minor version.

I'll update this issue once complete.

jrmd commented 5 years ago

hey @electerious @sjankowski this has now been published to npm as version 2.4