Problem is that on a page there are no hovered items. You have 2 options:
1) Place a link over the page and when user hovers it read the style and remove that link
2) Extract the info from stylesheets
Here is code for 2) but it works only in non-ie browsers (i was lazy)
Code: Select all
function findStyle(str) {
var linkstyle = {};
for(var i=0, ii=document.styleSheets.length; i<ii; i++) {
var rules = document.styleSheets[i].cssRules;
for(var r=0, rr=rules.length; r<rr; r++) {
if (rules[r].selectorText == str) {
var style = rules[r].style;
for(var s=0,ss=style.length; s<ss; s++) {
linkstyle[style[s]] = style.getPropertyValue(style[s]);
}
}
}
}
return linkstyle;
}
Here on devnetwork.net it returns:
Code: Select all
{
"color": "rgb(211, 17, 65)",
"text-decoration": "underline"
}