Cannot initialize Masonry with JQuery
问题 According to the official documentation there are different ways to initialize the masonry container. The HTML initialization works fine, but when I try to move the parameters from the data-masonry attribute to JQuery, things break. Here is the HTML initialization with the JSON params. <div id="container" class="masonry js-masonry" data-masonry-options='{ "columnWidth": ".grid-sizer", "itemSelector": ".item", "isFitWidth": true }'> And then this is what it currently looks like when I move