desandro / masonry

:love_hotel: Cascading grid layout plugin
https://masonry.desandro.com
16.43k stars 2.11k forks source link

masonry is applied to elements that are not defined in the options #1027

Closed timholz closed 6 years ago

timholz commented 6 years ago

Hi - i use masonry on a wordpress site. All works well. But masonry adds inline style to widgets in the footer that i did not define in the options. I tried to remove the inline style with jquery and also tried to prevent the layout on these elements, no luck. Ever heard of such a thing? I am aware that you prefer a code pen, but it is rather difficult to mimic this issue. regards theo

timholz commented 6 years ago

Hi - i found a workaround. It's not enough to just set initLayout to false. It is also necessary to remove all inline styles on resize. Then masonry can pe prevented. But still, it is strange that this happens to elements that are not defined.

$(window).on('resize', function () { $('.flexible-widget-area').masonry({ initLayout: false, }); $(".site-footer .flexible-widget-area, .site-footer .flexible-widget-area aside").removeAttr("style"); });

regards theo

desandro commented 6 years ago

Let's keep discussion to one issue. Closing as a duplicate of #1026