|
Hi,
I have created a web page with a button.
When user clicks this button, it is suppose to
load a new stylesheet.
I'm having a few problems with this script..
1) The code works locally for me, but not when
I copy it live.
2) I don't know how to load a new stylesheet
inside my code.
Any help would be appreciated.
Here is the button code....
<img src="/forum/images/magnify_plus.jpg" name="I" onClick="IncreaseFont()" />
In the head tag I placed the following....
<script language="JavaScript">
delCookie('IncreaseSize');
if (! document.cookie.IncreaseSize)
{
setCookie('IncreaseSize', 1);
}
function IncreaseFont()
{
var sTemp = getCookie('IncreaseSize');
iCount = Number(sTemp);
var sPage = "style_0";
if (iCount < 4)
{
iCount = iCount + 1;
delCookie('IncreaseSize');
setCookie('IncreaseSize', iCount);
sPage = sPage + iCount + "/forum/.css";
alert("Load stylesheet: " + sPage);
return;
}
else
{
alert("4 is highest");
delCookie('IncreaseSize');
setCookie('IncreaseSize', 4);
return;
}
}
</script>
|
|
|
|
|
|
|
// |