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 7007331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:35:36+00:00 2026-05-27T21:35:36+00:00

I have a load of images being pulled from WordPress attachments and then dumped

  • 0

I have a load of images being pulled from WordPress attachments and then dumped on the page using a masonry grid of sorts – all good. However, it takes a little long.

Is there any way to display a div, with some text, as the page is loading, and then display: none, after?

I have this so far:

<script type="text/javascript">
function showContent(){
//hide loading status...
document.getElementById("loading-grid-page").style.display='none';

//show content
document.getElementById("content").style.display='block';
}
</script>
</head>
<body onload="showContent()">
<script type="text/javascript">
document.write('<div id="loading-grid-page">Fetching ALL the gold...</div>');
</script>
<div id="content">
<script type="text/javascript">
//hide content
document.getElementById("content").style.display='none';
</script>

and my CSS,

#loading-grid-page {
color: #ffffff;
font: 700 11px/25px 'proxima-nova-1', 'proxima-nova-2', sans-serif;
letter-spacing: 1px;
text-transform: uppercase;
background: #111111 url('images/ajax-loader-black.gif') no-repeat 15px center;
border-radius: 2px;
border: 1px solid #111111;
padding: 5px 30px;
text-align: center;
width: 200px;
position: fixed;
left: 50%;
top: 50%;
margin-top: -50px;
margin-left: -100px;
z-index: 1000000;
}

However it throws back mixed results, sometimes it waits and all the masonry works, and sometimes it doesn’t and the masonry fails and the page loads strangely.

Just wondered if there was anything else out there 😉

Thanks,
R

  • 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-05-27T21:35:37+00:00Added an answer on May 27, 2026 at 9:35 pm

    I would do it this way:

    1. Load an empty page and display a loader.

      first time when you load the method just load (y) images, per example 12 will be enough. Don’t load all of them.
    2. Use (JQuery) Ajax to load the content.

      Use ajax/json to connect to the server and count the number of images left( total – displayed). if (total > 0) then return links to those images as a json array.

      link to jquery’s json call.
      link to parsing json using PHP.

    3. Hide the loader.

      Hide the div that contain the loader and add the links to the content div.

    4. Display the content.

      Here you have two options append a div, or use an existing one but this depends on the way you implemented the code, again I recommend JQuery.

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

Sidebar

Related Questions

I have a UITableView in my app in which I load several images from
I have images being dynamically added to a page, I don't seem to be
i have an UITableView in my app and i have to load some images
I develop a game that will have to load jpg images that now i
I have X sections. I want to lazy load images in different Custom Cell
I have a Javascript Map kit, and it use Image object to load images.
I have a UITableView whose cells contain custom ImageViews that asynchronously load the images
im making a wordpress plugin and i have a function where i import images,
I am using jQuery to build an array of images from a php array.
I have a few dynamically loaded images, with width and height being set inside

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.