473,408 Members | 2,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

enlarge text

Hi everyone,
Happy New Year, I found these line of javascript code to enlarge your font size.
this works but i can only set it up in one area or div area. is there a way i can use this function in other div area?

Thanks

Expand|Select|Wrap|Line Numbers
  1. function changeTextSize(amount) {
  2.     if (amount=="1") {
  3.         if (document.getElementById) {document.getElementById('intMainCellTextBlock').style.fontSize = '11px';} else {document.all.intMainCellTextBlock.style.fontSize = '11px';}
  4.         if (document.getElementById) {document.getElementById('intMainCellTextBlock').style.lineHeight = '13px';} else {document.all.intMainCellTextBlock.style.lineHeight = '13px';}
  5.     } else if (amount=="2") {
  6.         if (document.getElementById) {document.getElementById('intMainCellTextBlock').style.fontSize = '12px';} else {document.all.intMainCellTextBlock.style.fontSize = '12px';}
  7.         if (document.getElementById) {document.getElementById('intMainCellTextBlock').style.lineHeight = '14px';} else {document.all.intMainCellTextBlock.style.lineHeight = '14px';}
  8.     } else if (amount=="3") {
  9.         if (document.getElementById) {document.getElementById('intMainCellTextBlock').style.fontSize = '13px';} else {document.all.intMainCellTextBlock.style.fontSize = '13px';}
  10.         if (document.getElementById) {document.getElementById('intMainCellTextBlock').style.lineHeight = '15px';} else {document.all.intMainCellTextBlock.style.lineHeight = '15px';}
  11.     }
  12. }
Jan 10 '08 #1
2 1996
gits
5,390 Expert Mod 4TB
why not? :)

replace the id 'intMainCellTextBlock' with a variable node_id and pass it to the function. so node_id is the id of your desired textarea ...

Expand|Select|Wrap|Line Numbers
  1. function changeTextSize(amount, node_id) {
  2.     if (amount=="1") {
  3.         if (document.getElementById) {
  4.             document.getElementById(node_id).style.fontSize = '11px';
  5.         }
  6.         // and further code follows analogue
  7. }
  8.  
kind regards
Jan 10 '08 #2
why not? :)

replace the id 'intMainCellTextBlock' with a variable node_id and pass it to the function. so node_id is the id of your desired textarea ...

Expand|Select|Wrap|Line Numbers
  1. function changeTextSize(amount, node_id) {
  2.     if (amount=="1") {
  3.         if (document.getElementById) {
  4.             document.getElementById(node_id).style.fontSize = '11px';
  5.         }
  6.         // and further code follows analogue
  7. }
  8.  
kind regards

thanks i'll give it a try.
Jan 10 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: chris | last post by:
Hi, I need to add a text or image link which when click on will enlarge the text on a web page to ither large or largest. How can I do this, if its possible. Chris
3
by: u473 | last post by:
I need to enlarge an Access report from 8 1/2 x 11 to 13 x 19. Is there an easy way to do this rather than repositioning and enlarging each control ? Thank You. Celeste Edwards
2
by: Shamli | last post by:
I am looking for an algorithm that enlarge a 2D polygon. cheers,
3
by: Qoo | last post by:
Is there any tools like "stubedit" can let me enlarge the stack size under linux ? And I was quite wondering what's the default stack size of the program compiled with gcc without any parameter...
5
by: dovgani | last post by:
I have an unmanaged MFC project. The output is static lib. I would like to compile using /clr option. The native lib size is 64 megs and with /clr and /O1 options is 940 megs. Is it possibly...
1
by: Kwok | last post by:
Hello everyone, I am a newbie on this forum and I have some question about access. In my office, I am using MS access 2000 and the maximum length of a text column in the data table is 255 char. ...
4
by: Agnes | last post by:
MY application is designed based on 800 X600 screen size. However, some client use 1024 X768 , When they run the application, the form become smaller. I don't want to re-wrtie all the forms How...
4
by: Anette | last post by:
Hi, One can use the scrollbutton at the mouse + Ctrl button to enlarge and shrink text on a web page. This works fine for my pages in Firefox but not IE. Is there something I need to do to make it...
3
by: divina11 | last post by:
I'm wanting a html page with a series of thumbnails which are clickable to enlarge the image in a new window, how do you do this? Currently I have the images in the following format. <p> An...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.