codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  increase font function  kathym at 17:48 on Tuesday, July 01, 2008
 

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>








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: Passing Data from One Script to Another
•  untie attempted while 1 inner references still exist
•  Web Hosting
•  Re: refresh parent after closing pop up window
•  [Help] Javascript Quiz
•  Page scrolls to top when hiding or showing a div
•  Site disconnects unexpectedly
•  Re: dynamic crystal report generation
•  px to cm or reverse converting


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008