Currently, I have opted not to utilize css sprites.
While I acknowledge that it is the most efficient solution, time constraints prevent me from implementing it at this moment.
I am seeking a method to preload all images for hover and active selectors.
I came across a jQuery solution here
However, I am curious if there is a way for jQuery to dynamically read all active and hover selectors in my CSS files?
The filepath to my CSS file is /theme/V1/css/content.css
An example of the CSS file content is as follows:
.button_48x49_img {
width: 48px;
height: 49px;
}
.button_join_login_48x49_img {
background-image: url('a.png');
}
.button_join_login_48x49_img:hover {
background-image: url('b.png');
}
.button_join_login_48x49_img:active {
background-image: url('c.png');
}
Is there a way to preload only b.png
and c.png
without explicitly specifying this in the JavaScript preload code?