Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8948561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:01:27+00:00 2026-06-15T13:01:27+00:00

I am working on a hobby project which uses Jquery masonry to lay out

  • 0

I am working on a hobby project which uses Jquery masonry to lay out the items in my page. I use center layout so that no matter how many items I have, they always end up in the center of my page. In fact, it works. The problem is that when the page first loads, the layout is not centered, but on the left of the page. Then it ‘jumps’ to the desired layout.

Here is my an URL to show you what I mean by that. Notice that the layout isn’t ‘correct’ after the sudden jump. What I want is eliminate the jump, make the layout centered right when the layout is presented to users.

I used ImageLoaded plugin with masonry. Here is the related code:

$('#elements').imagesLoaded(function(){
            $('#elements').masonry({
                itemSelector: '.element',
                columnWidth: 245,
                gutterWidth: 6,
                isFitWidth: true,
                isAnimated: true
            });
});

And to center the layout I add following rules to #elements:

#elements{
margin: 0 auto;
}

As indicated by the masonry document here.

So what’s my problem then? Thanks for any input.

EDIT:

Thanks to @Bendim, I figured the way to do this. I have written my answer below but there is still one remaining problem: it takes a while for the whole interface to present itself, which is not ideal. Anyway, I will work on this. Thanks again, @Bendim.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:01:29+00:00Added an answer on June 15, 2026 at 1:01 pm

    @Bendim gave me an idea I meant to try for a while. But when I hide the #elements div, my element overlapped after I make it fade in. So instead I hide .element div, then fade in them. Here is what I did:

    .element {
        display: none;
    }
    

    then right after the masonry code:

    $('#elements).mansory(
        ...
    );
    
    $('.element').each(function(i){
        $(this).fadeIn('fast');
    });
    

    It worked perfectly, no jumps at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a small hobby project for personal use, which requires a way
I am working on a hobby project in which I have to crawl different
I'm currently working on a hobby project (C/C++) which is supposed to work on
So I've got a hobby site I'm working on. I've got items that are
I am working on a simple hobby project that checks when users connect/disconnect from
I'm working an project (pure hobby, Sharping my skills) which has one unified back-end
I am working a hobby project that is a file parsing library written in
I'm working on a hobby project which I'm slowly updating in my spare time
I'm working on a CMS as my hobby project. Because I'm not paid for
I'm working on a Minecraft-like engine as a hobby project to see how far

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.