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!

increase font size

Status
Not open for further replies.

boulie

Programmer
May 16, 2003
4
IE
can anyone help me. i need to increse the font size on my website using vbscript
 
do you have a style sheet?? which is included in header of all your html files??that would be best approach at a guess.
or do you mean you have explicitly set the font sizes of objects on your pages using the tags??? if you have done that i guess you have to run through all your html files and open as text streams and when you find text that specifies font size you should change the value

i would go for a style sheet include if it was me
 
i want the user to be able to click on a link/button and be able to increse the text by one pixel/size. i can do it in javascript but i cannot seem to do it in vbscript. here is the javascript. see what you make of it.


<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;>
<!--

function changeFontsize(fSize) {

var getElement = document.getElementsByTagName(&quot;p&quot;);

for (var i=0; i<getElement.length; i++) {
var eachElement = getElement;

eachElement.style.fontSize = fSize;
}
}
//-->
</script>

<html>
<body>
<a href=&quot;javascript: changeFontsize('15px');&quot; title=&quot;15px&quot;>15px</a>
<a href=&quot;javascript: changeFontsize('20px');&quot; title=&quot;20px&quot;>20px</a>
<a href=&quot;javascript: changeFontsize('25px');&quot; title=&quot;25px&quot;>25px</a>
<a href=&quot;javascript: changeFontsize('30px');&quot; title=&quot;30px&quot;>30px</a>
<p>hello</p>
</body>
</html>
 
if getElement = document.getElementsByTagName(&quot;p&quot;) is valid in vbscript client side then

getElement = document.getElementsByTagName(&quot;p&quot;)
For i = 0 To getElement.Length
eachElement.style.fontSize = fSize
Next

asp forum might be more help though as i dont know the object model
 
if getElement = document.getElementsByTagName(&quot;p&quot;)
is invalid.

any other way aroound it without using css. have no experience with css
 
dont think i can offer any help other than suggesting you post it on the ASP forum on this site, they will have more experience.
why not stick with javascript if you know it
 
Maybe:

Set getElement = document.getElementsByTagName(&quot;p&quot;)
For i = 0 To getElement.Length
eachElement.style.fontSize = fSize
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top