I'm currently working on a unique school project that involves creating multiple CSS styles for different views.
<link rel="stylesheet" type="text/css" href="css/main.css" title="main" media="screen">
<link rel="stylesheet" type="text/css" href="css/gyengen.css" title="alt" media="screen">
There are also buttons on the page to switch between these styles.
function changeStyle(main) {
var lnks = document.getElementsByTagName('link');
for (var i = lnks.length - 1; i >= 0; i--) {
if (lnks[i].getAttribute('rel').indexOf('style')> -1 && lnks[i].getAttribute('title')) {
lnks[i].disabled = true;
if (lnks[i].getAttribute('title') == main) lnks[i].disabled = false;
}}}
<div class="gyengen">
<span onclick="changeStyle('main')" class="normal"><img src="css/pictures/inverse.png" alt="Normal Style Sheet"></span>
<span onclick="changeStyle('alt')" class="inverse"><img src="css/pictures/inverse.png" alt="Inverse Style Sheet"></span>
</div>
In addition, there's an image map with a clickable area that links to an iframe target when clicked in a specific position.
<area shape="poly" coords="329,130,342,57,389,45,441,58,481,86,514,148,481,173,453,166,443,199,409,222,370,283,337,278,332,225,331,140" href="zones/gorgrond.html" alt="Gorgrond" title="Gorgrond" target="zone">
<iframe name="zone" onload='javascript:resizeIframe(this);'></iframe>
The goal is to change the CSS of both the parent window and the iframe when switching styles. Both pages are hosted on the same domain and have similar HTML structure.
EDIT: I am restricted to using only HTML5, XHTML Strict, jQuery/javascript for this project.