资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
一个实现字体大中小方法的JavaScript代码
<!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> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3CSCRIPT%20type%3Dtext%2Fjavascript%3E%20%0D%0Afunction%20%24(xixi)%20%7B%20%0D%0Areturn%20document.getElementById(xixi)%3B%20%0D%0A%7D%20%0D%0A%2F%2F%E8%BD%AC%E6%8D%A2%E5%AD%97%E5%8F%B7%20%0D%0Afunction%20doZoom(size)%7B%20%0D%0Aif(size%3D%3D12)%7B%20%0D%0A%24(%22contentText%22).style.fontSize%20%3D%20size%20%2B%20%22px%22%3B%20%0D%0A%24(%22fs12%22).style.display%20%3D%20%22%22%3B%20%0D%0A%24(%22fs14%22).style.display%20%3D%20%22none%22%3B%20%0D%0A%24(%22fs16%22).style.display%20%3D%20%22none%22%3B%20%0D%0A%7D%20%0D%0Aif(size%3D%3D14)%7B%20%0D%0A%24(%22contentText%22).style.fontSize%20%3D%20size%20%2B%20%22px%22%3B%20%0D%0A%24(%22fs12%22).style.display%20%3D%20%22none%22%3B%20%0D%0A%24(%22fs14%22).style.display%20%3D%20%22%22%3B%20%0D%0A%24(%22fs16%22).style.display%20%3D%20%22none%22%3B%20%0D%0A%7D%20%0D%0Aif(size%3D%3D16)%7B%20%0D%0A%24(%22contentText%22).style.fontSize%20%3D%20size%20%2B%20%22px%22%3B%20%0D%0A%24(%22fs12%22).style.display%20%3D%20%22none%22%3B%20%0D%0A%24(%22fs14%22).style.display%20%3D%20%22none%22%3B%20%0D%0A%24(%22fs16%22).style.display%20%3D%20%22%22%3B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%3C%2FSCRIPT%3E"> </head> <body> <DIV class=fontSize id=fs12 style="DISPLAY: none"><A href="javascript:doZoom(16)" _ewebeditor_ta_href="javascript%3AdoZoom(16)">大</A> <A href="javascript:doZoom(14)" _ewebeditor_ta_href="javascript%3AdoZoom(14)">中</A> <SPAN>小</SPAN></DIV> <DIV class=fontSize id=fs14><A href="javascript:doZoom(16)" _ewebeditor_ta_href="javascript%3AdoZoom(16)">大</A> <SPAN>中</SPAN> <A href="javascript:doZoom(12)" _ewebeditor_ta_href="javascript%3AdoZoom(12)">小</A></DIV> <DIV class=fontSize id=fs16 style="DISPLAY: none"><SPAN>大</SPAN> <A href="javascript:doZoom(14)" _ewebeditor_ta_href="javascript%3AdoZoom(14)">中</A> <A href="javascript:doZoom(12)" _ewebeditor_ta_href="javascript%3AdoZoom(12)">小</A></DIV> <DIV id=contentText>我是你的玫瑰花</DIV> </body> </html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程