enlarge text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mindshare
    New Member
    • Oct 2007
    • 10

    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

    [CODE=javascript]function changeTextSize( amount) {
    if (amount=="1") {
    if (document.getEl ementById) {document.getEl ementById('intM ainCellTextBloc k').style.fontS ize = '11px';} else {document.all.i ntMainCellTextB lock.style.font Size = '11px';}
    if (document.getEl ementById) {document.getEl ementById('intM ainCellTextBloc k').style.lineH eight = '13px';} else {document.all.i ntMainCellTextB lock.style.line Height = '13px';}
    } else if (amount=="2") {
    if (document.getEl ementById) {document.getEl ementById('intM ainCellTextBloc k').style.fontS ize = '12px';} else {document.all.i ntMainCellTextB lock.style.font Size = '12px';}
    if (document.getEl ementById) {document.getEl ementById('intM ainCellTextBloc k').style.lineH eight = '14px';} else {document.all.i ntMainCellTextB lock.style.line Height = '14px';}
    } else if (amount=="3") {
    if (document.getEl ementById) {document.getEl ementById('intM ainCellTextBloc k').style.fontS ize = '13px';} else {document.all.i ntMainCellTextB lock.style.font Size = '13px';}
    if (document.getEl ementById) {document.getEl ementById('intM ainCellTextBloc k').style.lineH eight = '15px';} else {document.all.i ntMainCellTextB lock.style.line Height = '15px';}
    }
    }[/CODE]
    Last edited by gits; Jan 10 '08, 10:31 PM. Reason: added code tags
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    why not? :)

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

    [CODE=javascript]function changeTextSize( amount, node_id) {
    if (amount=="1") {
    if (document.getEl ementById) {
    document.getEle mentById(node_i d).style.fontSi ze = '11px';
    }
    // and further code follows analogue
    }
    [/CODE]
    kind regards

    Comment

    • mindshare
      New Member
      • Oct 2007
      • 10

      #3
      Originally posted by gits
      why not? :)

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

      [CODE=javascript]function changeTextSize( amount, node_id) {
      if (amount=="1") {
      if (document.getEl ementById) {
      document.getEle mentById(node_i d).style.fontSi ze = '11px';
      }
      // and further code follows analogue
      }
      [/CODE]
      kind regards

      thanks i'll give it a try.

      Comment

      Working...