Results 1 to 1 of 1

Thread: Document Text Sizer

  1. #1
    Join Date
    May 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Document Text Sizer

    1) Script Title:
    Document Text Sizer
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamicindex9/textsizer.htm


    3) Describe problem:
    In the file "textsizer.js" you have
    Code:
    //Specify affected tags. Add or remove from list:
    var tgs = new Array( 'div','td','tr','th');
    
    //Specify spectrum of different font sizes:
    var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );
    var startSz = 2;
    
    function ts( trgt,inc ) {
    	if (!document.getElementById) return
    	var d = document,cEl = null,sz = startSz,i,j,cTags;
    	
    	sz += inc;
    	if ( sz < 0 ) sz = 0;
    	if ( sz > 6 ) sz = 6;
    	startSz = sz;
    		
    	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];
    
    	cEl.style.fontSize = szs[ sz ];
    
    	for ( i = 0 ; i < tgs.length ; i++ ) {
    		cTags = cEl.getElementsByTagName( tgs[ i ] );
    		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
    	}
    }
    ".
    Would it be posible to include the font-family or face in this as well?
    Everything works fine except that it changes my fonts from Verdana to something else.
    Also I have been visiting your site for years now and would like to take this opportunity to thank you for it. Thanks
    Last edited by Hermit; 05-15-2007 at 05:02 PM. Reason: No response

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •