Note that there are some explanatory texts on larger screens.

plurals
  1. PONot rendering masonry layout
    primarykey
    data
    text
    <p>I am trying to build a masonry page with some images. here is my code</p> <p><strong>CSS</strong></p> <pre><code> &lt;style&gt; .masonryImage{float:left;} &lt;/style&gt; </code></pre> <p><strong>JavaScript</strong></p> <pre><code> &lt;script src="http://code.jquery.com/jquery-1.10.1.min.js"&gt;&lt;/script&gt; &lt;!--&lt;script src="&lt;?=base_url('assets/js/bootstrap.min.js')?&gt;"&gt;&lt;/script&gt;--&gt; &lt;script src="&lt;?=base_url('masonry/masonry.min.js')?&gt;"&gt;&lt;/script&gt; &lt;script src="&lt;?=base_url('masonry/masonry.js')?&gt;"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var container = $('#container'); container.imagesLoaded( function(){ container.masonry({ itemSelector : '.masonryImage' }); }); &lt;/script&gt; </code></pre> <p><strong>HTML</strong></p> <pre><code> &lt;body id="container" style="height:100%;width:100%;background-color:#309be9;"&gt; &lt;div class="masonryImage"&gt; &lt;img src="http://cdn.cutestpaw.com/wp-content/uploads/2013/11/s-Playing-fetch.jpg" alt=""&gt; &lt;/div&gt; &lt;div class="masonryImage"&gt; &lt;img src="http://cdn.cutestpaw.com/wp-content/uploads/2013/11/s-Polar-bear.jpg" alt=""&gt; &lt;/div&gt; &lt;div class="masonryImage"&gt; &lt;img src="http://cdn.cutestpaw.com/wp-content/uploads/2013/11/s-precious.jpg" alt=""&gt; &lt;/div&gt; &lt;div class="masonryImage"&gt; &lt;img src="http://cdn.cutestpaw.com/wp-content/uploads/2013/11/s-baby-penguin.....jpg" alt=""&gt; &lt;/div&gt; &lt;div class="masonryImage"&gt; &lt;img src="http://cdn.cutestpaw.com/wp-content/uploads/2013/11/s-And-just-because-well-just-because-we-CAN.jpg" alt=""&gt; &lt;/div&gt; &lt;div class="masonryImage"&gt; &lt;img src="http://cdn.cutestpaw.com/wp-content/uploads/2013/11/s-Bunnies-and-flowers...jpg" alt=""&gt; &lt;/div&gt; &lt;div class="masonryImage"&gt; &lt;img src="http://cdn.cutestpaw.com/wp-content/uploads/2013/11/s-captionme.jpg" alt=""&gt; &lt;/div&gt; &lt;div class="masonryImage"&gt; &lt;img src="http://cdn.cutestpaw.com/wp-content/uploads/2013/11/s-Its-mum-is-called-Alinga..jpg" alt=""&gt; &lt;/div&gt; &lt;div class="masonryImage"&gt; &lt;img src="http://cdn.cutestpaw.com/wp-content/uploads/2013/11/s-Curious-bobcat-cub-by-Megan-Lorenz.jpg" alt=""&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>I dint understand where the bug is, the page is not rendering in mansory style.</p> <p>please suggest.</p> <p><strong>UPDATE:</strong></p> <p>After trying the two suggested javascripts the images started overlapping . Actually the code itself is not responsible for this. But something is going wrong with masonry. here is the screen shot If you notice clearly i highlighted with a red mark, it shows some of the images and hiding!!</p> <p><img src="https://i.stack.imgur.com/7w7Xd.png" alt="enter image description here"> </p> <p>Ahh this is playing with me</p> <p>If i try inspect element, the images are returning to their position <img src="https://i.stack.imgur.com/dRQBr.jpg" alt="enter image description here"></p> <p>Too puzzeled</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload