-
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
-
<html xmlns=\"http://www.w3.org/1999/xhtml\">
-
<head>
-
<title>字体大中小字号选择的另一种方法</title>
-
<style type=\"text/css\">
-
<!--
-
body {font-size:14px}
-
-->
-
</style>
-
<SCRIPT type=text/javascript>
-
function $(xixi) {
-
return document.getElementById(xixi);
-
}
-
//转换字号
-
function doZoom(size){
-
if(size==12){
-
$(\"contentText\").style.fontSize = size + \"px\";
-
$(\"fs12\").style.display = \"\";
-
$(\"fs14\").style.display = \"none\";
-
$(\"fs16\").style.display = \"none\";
-
}
-
if(size==14){
-
$(\"contentText\").style.fontSize = size + \"px\";
-
$(\"fs12\").style.display = \"none\";
-
$(\"fs14\").style.display = \"\";
-
$(\"fs16\").style.display = \"none\";
-
}
-
if(size==16){
-
$(\"contentText\").style.fontSize = size + \"px\";
-
$(\"fs12\").style.display = \"none\";
-
$(\"fs14\").style.display = \"none\";
-
$(\"fs16\").style.display = \"\";
-
}
-
}
-
</SCRIPT>
-
</head>
-
<body>
-
<DIV class=fontSize id=fs12 style=\"DISPLAY: none\"><A
-
href=\"javascript:doZoom(16)\">大</A> <A
-
href=\"javascript:doZoom(14)\">中</A> <SPAN>小</SPAN></DIV>
-
<DIV class=fontSize id=fs14><A
-
href=\"javascript:doZoom(16)\">大</A> <SPAN>中</SPAN> <A
-
href=\"javascript:doZoom(12)\">小</A></DIV>
-
<DIV class=fontSize id=fs16 style=\"DISPLAY: none\"><SPAN>大</SPAN> <A
-
href=\"javascript:doZoom(14)\">中</A> <A
-
href=\"javascript:doZoom(12)\">小</A></DIV>
-
<br /><br />
-
<DIV id=contentText>源码爱好者提供各类编程源码、素材、书籍教程、网页特效代码以及常用软件下载。</DIV>
-
<p>说明:此方法有别于之前发布的<a href=\"http://www.codefans.net/jscss/code/2607.shtml\" target=\"_blank\">字体大中小代码字号缩放代码</a>,点击链接后,当前字号则不显示链接。</p>
-
</body>
-
</html>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29737856/viewspace-1244175/
,如需转载,请注明出处,否则将追究法律责任。