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

  • Home
  • SEARCH
  • 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 6029919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:57:33+00:00 2026-05-23T04:57:33+00:00

I am using .load() in jQuery to load in html content, but in this

  • 0

I am using .load() in jQuery to load in html content, but in this content there are 3/4 images embedded. The success event only fires on .load() when all the html is loaded in and not actually the images, does anyone know a way of preloading the full content of a page?

$('#ajax_loader').hide().load('page.html',function(){
  $(this).fadeUp(1000);
});

This is my simple code (rest of it is in the full app), loading in the following code (ie. page.html)

<div>
  <div id="slideshow">
    <img src="images/img1.jpg" />
    <img src="images/img2.jpg" />
    <img src="images/img3.jpg" />
  </div>
  <p>This is some sample content</p>
</div>
  • 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-23T04:57:34+00:00Added an answer on May 23, 2026 at 4:57 am

    I suggest that you don’t use a fadeIn animation after the images are loaded because of performance degradation it brings. It is usually a good idea to fadeIn the content then start loading the images to ensure that the animation is smooth for as many users as possible.

    Having said that, of course you can accomplish your original goal if you want to stick with it:
    Use a 1×1 blank image as the image src attribute and store the real url in the title.

    <div>
      <div id="slideshow">
        <img src="blank.gif" title="images/img1.jpg" />
        <img src="blank.gif" title="images/img2.jpg" />
        <img src="blank.gif" title="images/img3.jpg" />
      </div>
      <p>This is some sample content</p>
    </div>
    

    And your code becomes:

    $('#ajax_loader').hide().load('page.html', function(){
      var c = 0;
      var images = $("#slideshow img");
      images.load(function(){
        if (++c == images.length) {
          $('#ajax_loader').fadeIn(1000);
        }
      });
      images.each(function(){
        this.src = this.title;
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the jquery library to load the content of an html file. Something
I am trying to load html asynchronously using jQuery ajax function. But I for
I am using jQuery to load a page by AJAX using $.ajax (suppose test.html).
I am using lazy load jquery plugin . It tells me to put this
I am using jQuery .load to call an action but it is not found.
There's placeholder on the page that is loaded asynchronously using jQuery load method. Page
It is quite easy to load HTML content from your custom URLs/Web services using
I am using jquery load method to update divs , it works great until
I am trying to load mschart in my aspx page(SalesOverview.aspx) using jQuery.load() method, I
I'm using the .load() function in jquery to insert the results of a php

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.