dijit.wai.onload
dojo.require("dijit");
defined in dijit/_base/wai.js
Detects if we are in high-contrast mode or not
Usage
function () (view source)
// This must be a named function and not an anonymous // function, so that the widget parsing code can make sure it // registers its onload function after this function. // DO NOT USE "this" within this function. // create div for testing if high contrast mode is on or images are turned off var div = dojo.doc.createElement("div"); div.id = "a11yTestNode"; div.style.cssText = 'border: 1px solid;' + 'border-color:red green;' + 'position: absolute;' + 'height: 5px;' + 'top: -999px;' + 'background-image: url("' + dojo.moduleUrl("dojo", "resources/blank.gif") + '");'; dojo.body().appendChild(div); // test it var cs = dojo.getComputedStyle(div); if(cs){ var bkImg = cs.backgroundImage; var needsA11y = (cs.borderTopColor==cs.borderRightColor) || (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)" )); dojo[needsA11y ? "addClass" : "removeClass"](dojo.body(), "dijit_a11y"); dojo.body().removeChild(div); }