|
Project Information
Members
Featured
Downloads
Links
|
alternateStyles.js is a Javascript object, which once implemented allows the users of a website to switch styles (within the limits set by the developer) on each element of a xhtml document. ExamplesThese examples don’t really show off the potential of alternateStyles.js, however they are commonly used around the web. DependenciesalternateStyles.js has one main dependency, it requires a document.getElementsBySelector() method present. Rather then reinvent the wheel I’d recommend using Simon Willison’s getElementsBySelector FAQHow does this differ from Alternate Style Sheets? Alternative Style: Working With Alternate Style Sheets is a great example of ‘Alternate Style Sheets’, which definitely has it’s place. They differ because ‘Alternate Style Sheets’ is exactly that, an alternate style sheet, while alternateStyles.js changes styles on DOM Elements. You could use the two together. But what about browser compatibilityTested and working in:
All “modern browsers” should be supported. However, in the off-chance that one of your users browsers isn’t supported there’s no reason for alternateStyles.js to break your current website. |