javascript - The masonry bricks are stacked together until page resize on Wordpress -


i found few questions on stackoverflow didn't resolve problem, i'm trying asking here.

when load page masonry bricks stacked in top/left of window. when resize page arrange in correct position. i'm using javascript in page of wordpress. code @ bottom of page:

<script src="http://www.bitumephotofest.it/wordpress/wp-content/themes/sequential/js/masonry.pkgd.min.js"></script>  <script> var container = document.queryselector('#container'); var msnry = new masonry( container, {   // options   columnwidth: 10,   itemselector: '.item' }); </script> 

i undestrood previous questions on stackoverflow have use "imagesloaded()". , how should add it? i'm novice in javascript.

any suggests?

it's difficult know without example url try:

<script> $(document).ready(function() {   var container = document.queryselector('#container');   var msnry = new masonry( container, {   // options   columnwidth: 10,   itemselector: '.item'   }); }); </script> 

Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -