JS 控制 字体大小变化

原文来自:http://www.52004.com.cn/874.html

<script language="JavaScript">
function doZoom(size){
document.getElementById('zoom').style.fontSize=size+'px'
setTailPosition()
}
</script>


<table >
<td ><font id="zoom" style="font-size:14px">
这里是测试的这里是测试的这里是测试的这里
是测试的这里是测试的这里是测试的这里是
测试的这里是测试的这里是测试的这里是测
试的这里是测试的这里是测试的这里是测试
的这里是测试的这里是测试的
这里是测试的这里是测试的这里是测试的这
里是测试的这里是测试的这里是测试的这里
试的这里是测试的</font ></td>
</table>

【<A href="javascript:doZoom(16)">大</A>
<A href="javascript:doZoom(14)">中</A>
<A href="javascript:doZoom(12)">小</A>】

====================================================

<script language=”javascript”>
//更改字体大小
var status0=”;
var curfontsize=10;
var curlineheight=18;
function changefontA(){
if(curfontsize>9){
document.getElementById(’preview_res_content’).style.fontSize=(–curfontsize)+’pt’;
document.getElementById(’preview_res_content’).style.lineHeight=(–curlineheight)+’pt’;
}
}
function changefontB(){
if(curfontsize<64){
document.getElementById(’preview_res_content’).style.fontSize=(++curfontsize)+’pt’;
document.getElementById(’preview_res_content’).style.lineHeight=(++curlineheight)+’pt’;
}
}
</script>

<a href=”http://www.chaoketu.com/javascript:changefontA();”>【字体缩小】</a>
<a href=”http://www.chaoketu.com/javascript:changefontB();”>【字体放大】</a>

==============================
【<a href=”http://www.chaoketu.com/javascript:void(0)” onmouseup=”document.getElementById(’11′).style.fontSize=’150%’; return(false);”>大</a>】
【<a href=”http://www.chaoketu.com/javascript:void(0)” onmouseup=”document.getElementById(’11′).style.fontSize=’100%’; return(false);”>中</a>】
【<a href=”http://www.chaoketu.com/javascript:void(0)” onmouseup=”document.getElementById(’11′).style.fontSize=’75%’; return(false);”>小</a>】

posted @ 2009-02-19 15:12  s80895304  阅读(789)  评论(0编辑  收藏  举报