网站制作

本类阅读TOP10

·IIS 安装配置全攻略
·用VS.NET打开网上下载的.NET web项目出错的解决办法
·HTML 4.0 语言快速参考
·限制TextArea区的文字输入数量
·如何在网页上实现进度条
·Apache的配置步骤及测试
·谈谈Jesse James Garrett提到的Ajax
·html基础学习笔记(2)
·页面垂直居中的两种方法
·用asp遍历目录下文件的例子

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
实时改变样式的例子

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

1、利用CSS来改变的例子
<head>
<script>
function StyleChange(StyleName)
{ChangeStyle.className=StyleName;}
</script>

<style>
<!--
.style1  { FONT-FAMILY: Georgia; }
.style2  { FONT-FAMILY: 宋体; }
-->
</style>

</head>

<span onclick=StyleChange("style1") style="cursor:hand">样式1</span>
<span onclick=StyleChange("style2") style="cursor:hand">样式2</span>

<table>
<tr>
<td id=ChangeStyle>
1981年11月19日
</td>
</tr>
</table>

2、又一个实时改变样式的例子:
<script language=javascript>
function FontChange(fontsize)
{
 document.getElementById('fontchange').style.fontSize=fontsize+'px'
}
</script>

<a href="javascript:FontChange(48)">click here</a>

<span id="FontChange">1981年11月19日</span>




相关文章

相关软件