JQuery get css hover values

On the ready page, I want to run a function that gets the background-image css setting, and also hover the background image, which I want to use in another way.

The only method I've seen for this requires that someone actually mouse on the element before you can get the value.

Does anyone have a way?

Here's how to get the css value without freezing:

$(this).css('background-color');
+5
source share
1 answer

. , document.styleSheets, .cssRules .rules, .selectorText, , .

, () JSS. , #someId:hover, JSS background-color :

jss('#someId:hover').get()['background-color']
+4

All Articles