ataraxis
10-05-2005, 11:11 AM
HI,
my problem is accessing a selected style sheet for the entire site.
to be precise, my index page provides with options like
theme1
theme2
and each theme is assigned a style sheet.
which when selected would load that particular style sheet for that page, not for the entire site.how do we make it accessible for the entire site.
index.html:
<html>
<head>
<title> style sheet example</title>
<link rel="stylesheet" href="style1.css">
<link rel="stylesheet" href="style2.css" disabled>
<script language="javascript">
function style(n,enable)
{
if (!document.getElementsByTagName) return;
links=document.getElementsByTagName("link");
links[n].disabled=!enable;
links[1-n].disabled=true;
}
style(0,false);
</script>
</head>
<body>
<a href="page2.html">page2</a>
<ul>
<li><a href="javascript:style(0,false);">style sheet # 1</a></li>
<li><a href="javascript:style(1,true);">style sheet # 2</a></li>
<li><a href="javascript:style(0,true);">No style sheet</a></li>
</ul>
</body>
</html>
my problem is accessing a selected style sheet for the entire site.
to be precise, my index page provides with options like
theme1
theme2
and each theme is assigned a style sheet.
which when selected would load that particular style sheet for that page, not for the entire site.how do we make it accessible for the entire site.
index.html:
<html>
<head>
<title> style sheet example</title>
<link rel="stylesheet" href="style1.css">
<link rel="stylesheet" href="style2.css" disabled>
<script language="javascript">
function style(n,enable)
{
if (!document.getElementsByTagName) return;
links=document.getElementsByTagName("link");
links[n].disabled=!enable;
links[1-n].disabled=true;
}
style(0,false);
</script>
</head>
<body>
<a href="page2.html">page2</a>
<ul>
<li><a href="javascript:style(0,false);">style sheet # 1</a></li>
<li><a href="javascript:style(1,true);">style sheet # 2</a></li>
<li><a href="javascript:style(0,true);">No style sheet</a></li>
</ul>
</body>
</html>