Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Masonry loading images display:none issue.

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #43027
    revolutiong
    Participant

    When masonry loads images it first puts all the images into one column then sorts them. This creates a lot of space before the actual load.

    I tried to use CSS to add display:none to the container, then javascript display:block when everything is loaded. But its seems to only show the last image.

    Think I need masonry to do the display none so it can read all the images, but am not sure actually were to put this code.

    Any tips would be great, thanks.

    #126391
    revolutiong
    Participant

    Solved.

    $(document).ready(function(){
    var $container = $(‘.masonry-c’);
    var min_width = 266;
    $(‘.masonry-c’).hide();
    $container.imagesLoaded( function(){
    $(‘.masonry-c’).show();

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.