Code
1 var tgs = new Array( 'div','td','tr');
2 var szs = new Array( '8px','10px','12px','14px','16px','18px','20px' );
3 var startSz = 2;
4 function ts(inc) {
5 if (!document.getElementById) return
6 var d = document,cEl = null,sz = startSz,i,j,cTags;
7
8 sz += inc;
9 if ( sz < 0 ) sz = 0;
10 if ( sz > 6 ) sz = 6;
11 startSz = sz;
12
13 cEl = d.body;
14 cEl.style.fontSize = szs[ sz ];
15
16 for ( i = 0 ; i < tgs.length ; i++ ) {
17 cTags = cEl.getElementsByTagName( tgs[ i ] );
18 for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
19 }
20 }
21
posted on
2009-06-19 14:33
晟晟
阅读(
679)
评论()
编辑
收藏
举报