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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:01:05+00:00 2026-05-24T20:01:05+00:00

I have this function in a file called plugins.js : $.fn.preload = function(){ this.each(function(){

  • 0

I have this function in a file called plugins.js:

$.fn.preload = function(){
    this.each(function(){
        $('<img/>')[0].src = this;
    });
}

Then I have this in another file called footer.js:

$(['img1.jpg','img2.jpg','img3.jpg']).preload();

Shouldn’t all this preload the images?

The images are all in a folder called “graphics”.

I suspect the images are not preloaded because it takes a little while for the images to load when I am hovering the mouse over a button (I use the images for mouseOver effects).

Is there any method to check for sure that the images have been preloaded? Can I do so with the above script?

I am not very good with jquery so code help is appreciated.

Thanks

  • 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-24T20:01:06+00:00Added an answer on May 24, 2026 at 8:01 pm

    There is no method which will say whether the images have been preloaded or not. You can use image load event to determine whether image is loaded or not.

    E.g

    $("img").load(function(){
       //Image loaded
    });
    

    There is also error event which gets triggered if the image load fails due to any reason

     $("img").error(function(){
           //Image load failed
     });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this include function in a file inside another folder called ajax, but
I saw this function in the lua.c file called dotty() . I have a
Let say I have this code in a JS file called plus2.js: function plus2(n){
I have this function to read in all ints from the file. The problem
I have a 2884765579 bytes file. This is double checked with this function, that
I use an externel javascript file and i have this, function getdropdownvalue() { alert($(#<%=DLState.ClientID%>));
I have a bash script file which starts with a function definition, like this:
I have this function correctly linked in an external .js file... function SubmitAge(age, UpdatePanelID,
Ok, so I have a file called functions.ps1 that contains only function code: something
So I'm using zend framework and I have this code in a file called

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.