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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:24:10+00:00 2026-05-26T11:24:10+00:00

This is quite specific, so I couldn’t just find an answer on the internet!

  • 0

This is quite specific, so I couldn’t just find an answer on the internet!

I have some code that is loading in some images that I want to be displayed on hover. Everything works fine but sometimes there is a delay when clicking a checkbox in divs where the hover function is being used.

jQuery(document).ready(function(){

$icons = [];

$('#boat_icon').hide();

jQuery('.boat_row').each(function(e){
            $icons.push('url("' + $(this).attr("id") + '")');
            });

jQuery($icons).each(function(e){

jQuery('#boat_icon').css('background-image', this);

console.log(this + "loaded!");

});

$('#boat_icon').show();
});

 jQuery('.boat_row').hover(function(e){
     e.preventDefault();

     $(this).css('background-color', 'D8EAFF')

     var iconpath = $(this).attr("id");
     $('#boat_icon').css('background-image', 'url("'+iconpath+'")');
     },

     function(){
     $(this).css('background-color', '')
 });   

The iconpath is a string in the database, so I was wondering… is this the correct way to use preloaded images? Because the images are loaded on ready, are they then being used from the cache or are they being loaded again every time on hover because im not displaying a stored image object?

  • 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-26T11:24:10+00:00Added an answer on May 26, 2026 at 11:24 am

    You should use this preloading:

    if (document.images)
    {
      pic1= new Image(100,25); 
      pic1.src="http://someplace.com/image1.gif"; 
    }
    

    if (document.images) is used to verify doesn’t browser support preloading for images

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

Sidebar

Related Questions

I have this quite popular problem, but have failed to find a solution that
This is quite a specific question, and I have had no luck on the
In my application I have quite some void-pointers (this is because of historical reasons,
I have a data structure that represents C# code like this: class Namespace: string
I'm not quite sure if this is specific to Sun Java Systems Application Server
My application will have some customisation for each company that uses it. Up until
I have a C# application that creates shortcuts to launch other programs with specific
I have been in this situation quite a few times where visual studio does
I'm aware of IDENTITY fields but I have a feeling that I couldn't use
I recently came across some code that looked like: if(sizeof(var,2) == 4) { ...

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.