sun
sun

Reputation: 1668

Images disappear when i include masonry jquery script

I'm trying to use the masonry script to get the images as gallery without any gap according to different sized images. I tried the jQuery way initialize but i can't able to see the images when the script is initialized. but if i didn't do the script initialize i mean not using masonry i can able to see the images.

I think Script applying position:absolute i don't have idea of what going on.

CODE:

 $(document).ready(function() {                  
    var $container = $('#p-grid');
    // initialize
    $container.masonry({
        columnWidth: 200,
        itemSelector: '.photos'
    });
    var msnry = $container.data('masonry');
});

Why is this happening? What is the problem here? Am i doing it correctly?

Jsfiddle

Upvotes: 0

Views: 278

Answers (1)

rajesh kakawat
rajesh kakawat

Reputation: 10896

try something like this,FIDDLE

.pic {
width: 100px;
height: 100px;
position: relative
}

.pic img {
    width: 100px;
    height: 100px;
}

Upvotes: 1

Related Questions