Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

increse font size

Status
Not open for further replies.

boulie

Programmer
May 16, 2003
4
IE
i am trying to increase the font size on my site. the user clicks a link/button to increase the text in the entire page. i want to use vbscript.
 
The ONLY VBScript you should use is server-side VBScript (ASP). This means you're gonna be resubmitting it to itself. So maybe you could have something like

<%
lng_FontSize = Request.QueryString(&quot;f&quot;)
if not isnumeric(lng_FontSize) then lng_FontSize = 10
%>
...
<style>
.font1 {font-size:<%=lng_FontSize%>;}
</style>
...
<a class=&quot;font1&quot; href=&quot;thispage.asp?f=8&quot; target=&quot;_self&quot;>8 point</a>
<a class=&quot;font1&quot; href=&quot;thispage.asp?f=12&quot; target=&quot;_self&quot;>12 point</a>



codestorm
Newbie Life Member.
Fire bad. Tree pretty. - Buffy
<insert witticism here>
 
You could use a combination of CSS and the client-side scripting language of your choice to do this.

First define a font-size for your body in the style section of the head of the page:
Code:
<html>
<head>
<style>
body{
   font-size: 11;
}
</style>
</head>
<body>
Here is some text
</body>
</html>

Then add your button and use the onClick event to change that style attribute. My example is goig to be in in javascript because I don't use VBScript client-side:
Code:
<html>
<head>
<style>
body{
   font-size: 11;
}
</style>
</head>
<body>
Here is some text
<input type=&quot;button&quot; onClick=&quot;body.style.fontSize = '15';&quot; value=&quot;Large Text&quot;>
</body>
</html>

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
*grin* I didn't want to suggest that 'cos my cross-browser scripting is a bit rusty.

codestorm
Newbie Life Member.
Fire bad. Tree pretty. - Buffy
<insert witticism here>
 
Oh it's definately not cross browser :) To many people still using NS 4 :p

Should work for all up to date browsers though.

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top