My site will change color schemes when a user presses the button in the top left. I want to add a third theme though. I can’t figure it out though.
My html as relevent
[CODE] <!–EXTERNAL FILES–>
<link rel=”stylesheet” type=”text/css” href=”main.css” />
<!–[if IE]><link rel=”stylesheet” type=”text/css” href=”mainIE.css” /><![endif]–>
<link id=”altstyle” rel=”stylesheet” type=”text/css” href=”main.css” />
<script type=”text/javascript” src=”main.js”></script>
<!–STOP EXTERNAL FILES–>
<title>Votillity.com</title>
<!–CSS INTERNAL–>
<!–CSS INTERNAL–>
<!–JAVASCRIPT INTERNAL–>
<!–JAVASCRIPT INTERNAL–>
</head>
<body onload=”startTime()”>
<img class=”Zindexsty1″ style=”position: fixed; top: 0px; left: 0px;” src=”http://votillity.com/VotillityLogo1.png” alt=”VOTILLITY” />
<img class=”Zindexsty2″ style=”position: fixed; top: 0px; left: 0px;” src=”http://votillity.com/VotillityLogo2.png” alt=”VOTILLITY” />
<button id=”altstyact” class=”button” style=”position: fixed; top: 0px; left: 170px; width: 60px;”>Theme</button>
Javascript
[CODE]//ALTERNATE STYLES
function changeStyle()
{
var obj1=document.getElementById(‘altstyact’);
var obj2=document.getElementById(‘altstyle’)
test=true;
obj1.onclick=function()
{
test==true?
(obj2.href=’main2.css’,obj1.firstChild.nodeValue=’Classic’,test=false):
(obj2.href=’main.css’,obj1.firstChild.nodeValue=’Ice’,test=true)
}
}
if(window.addEventListener)
{
window.addEventListener(‘load’,changeStyle,false);
}
else
{
if(window.attachEvent)
{
window.attachEvent(‘onload’,changeStyle);
}
}
//STOP ALTERNATE STYLES
I don’t think you need the css’s. If, however, I’m wrong just let me know. Keep in mind that the javascript is external.
Here’s my site if you need a better look [URL=”http://votillity.com”]Votillity
Thank you