Does anyone know a good way to preload css hover images using jQuery?
Ideally, I would like to add a class (say, " pre-load-hover ") to any element that needs to be preloaded, and then put some js in $(document).ready() to cycle through any DOM elements with with this class, find their css background image and load it.
The problem is that I cannot find a way to easily get to the location of the image hover. The jQuery :hover selector does not seem to work.
I also do not want to load all the stylesheets and look for the selector with some string search.
source share