Super Simple Style Sheet Switcher – armoire

Category: Javascript | February 5, 2015
Author:odraencoded
Views Total:103 views
Official Page:Go to website
Last Update:February 5, 2015
License:MIT

Preview:

Super Simple Style Sheet Switcher – armoire

Description:

armoire is a very simple JavaScript library which allows the visitor to switch between alternative style sheets to apply to your webpage or a given container, without writing any JavaScript. Download, unzip and check out the examples folder for more examples.

Basic usage:

Add unique IDs to your alternative style sheets.

<link id="gray-bg-style" title="Gray" rel="stylesheet" href="gray-bg.css">
<link id="yellow-bg-style" title="Yellow" rel="alternate stylesheet" href="yellow-bg.css">

Create links to switch between these two style sheets by clicking.

<a href="#gray-bg-style" class="set-style">Gray background</a>
<a href="#yellow-bg-style" class="set-style">Yellow background</a>

Load the armoire.js script in your document and done.

<script src="path/to/armoire.js"></script>

You Might Be Interested In:


Leave a Reply