Topic: Accessing Javascript Pseudo Styles (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=30635" title="Pages that link to Topic: Accessing Javascript Pseudo Styles (Page 1 of 1)" rel="nofollow" >Topic: Accessing Javascript Pseudo Styles <span class="small">(Page 1 of 1)</span>\

 
Maskkkk
Paranoid (IV) Inmate

From: Johnstown, PA
Insane since: Mar 2002

IP logged posted posted 11-04-2008 16:00 Edit Quote

Hello Inmates,

Is there anyway in JS to access the background-color of a pseudo-class element such as a:hover, when the element is not currently being hovered over with the mouse?



- AIM: MASKKKK

01001101011000010111001101101011011010110110101101101011

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 11-04-2008 16:18 Edit Quote

Well, it is doable but it's a real PITA. You have to go through the list of CSS rules and if one defines a :hover pseudo class, you have to check whether it applies to the element you're interested in. Not trivial to make in a generic way.

Maskkkk
Paranoid (IV) Inmate

From: Johnstown, PA
Insane since: Mar 2002

IP logged posted posted 11-04-2008 16:30 Edit Quote

Um, yeah this wasn't really my question...

It's one of my co-workers, the department is just getting used to the web now...it's been a bit awkward like middle school....so how do you go through a list of CSS rules?

Nathus
Bipolar (III) Inmate

From: Minnesota
Insane since: Aug 2003

IP logged posted posted 11-04-2008 18:56 Edit Quote

Here's a link that gives some basic info on going through the CSS Rule object using JavaScript

http://www.javascriptkit.com/dhtmltutors/externalcss3.shtml

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 11-04-2008 19:42 Edit Quote

document.styleSheets reference with links to the DOM2 CSS StyleSheet interface.

Wasn't it your question or the question ?

Maskkkk
Paranoid (IV) Inmate

From: Johnstown, PA
Insane since: Mar 2002

IP logged posted posted 11-04-2008 20:46 Edit Quote

Poi,

It wasn't my question, I never even thought of wanting to do this...



- AIM: MASKKKK

01001101011000010111001101101011011010110110101101101011


(Edited by Maskkkk on 11-04-2008 20:54)

coach
Bipolar (III) Inmate

From:
Insane since: May 2011

IP logged posted posted 05-31-2011 11:11 Edit Quote
Edit TP: spam removed


Post Reply
 
Your User Name:
Your Password:
Login Options: Remember Me On This Computer
 
Your Text:
Loading...
Options: Show Signature
Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu