Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok, it sounds like you want to change the global CSS so which will effictively change all elements of a peticular style at once. I've recently learned how to do this myself from a <a href="http://www.shawnolson.net/a/503/altering-css-class-attributes-with-javascript.html" rel="noreferrer">Shawn Olson tutorial</a>. You can directly reference his code <a href="http://www.shawnolson.net/scripts/public_smo_scripts.js" rel="noreferrer">here</a>.</p> <p>Here is the summary:</p> <p>You can retrieve the <a href="https://developer.mozilla.org/En/DOM/Stylesheet" rel="noreferrer">stylesheets</a> via <code>document.styleSheets</code>. This will actually return an array of all the stylesheets in your page, but you can tell which one you are on via the <code>document.styleSheets[styleIndex].href</code> property. Once you have found the stylesheet you want to edit, you need to get the array of rules. This is called "rules" in IE and "cssRules" in most other browsers. The way to tell what <a href="https://developer.mozilla.org/en/DOM/cssRule#CSSStyleRule" rel="noreferrer">CSSRule</a> you are on is by the <code>selectorText</code> property. The working code looks something like this:</p> <pre><code>var cssRuleCode = document.all ? 'rules' : 'cssRules'; //account for IE and FF var rule = document.styleSheets[styleIndex][cssRuleCode][ruleIndex]; var selector = rule.selectorText; //maybe '#tId' var value = rule.value; //both selectorText and value are settable. </code></pre> <p>Let me know how this works for ya, and please comment if you see any errors.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload