Is there a reliable method for preloading CSS hover images using jQuery that anyone knows of?
My ideal scenario would involve adding a class (for example, "pre-load-hover
") to any element needing preloading, and then implementing JavaScript in $(document).ready()
to iterate through DOM elements with said class, identify their CSS background-image, and load it.
The challenge I'm facing is figuring out how to easily access the location of the hover image. The jQuery selector :hover
doesn't seem to provide a solution.
Additionally, I'd like to avoid loading all the stylesheets and searching for the selector using string searches.