电脑技术学习

推荐几个入门级的JS特效代码

dn001

  1、以事件驱动JavaScript 函数


以下是引用片段:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script>
<!--
function hello()
{
aa=100
cc='欢迎第'+aa+'次光临!'
alert(cc)
}
//-->
</script>
</head>
<body >
<a href="网址" onmouseover="hello()"> 网页名</a>
</body>
</html>


  2、文本域显示内容,但不可修改

以下是引用片段:
<input value="网页名" readonly>


  3、让select控件可以自定义边框

以下是引用片段:
<style>
.box2{border:1px solid #00ff00;width:180px;height:17px;clip:rect(0px,179px,16px,0px);overflow:hidden;}
select{position:relative;left:-2px;top:-2px;font-size:12px;width:183px;line-height:14px;border:0px;color:#909993;}
</style>
<div class=box2><select id=idselect1 onchange="select1();" hidefocus>
<option selected>网页名</option>
<option>设计在线</option>
<option>办公软件</option>
<option>工具软件<option>
</select></div>


4、CSS圆角

以下是引用片段:
<html xmlns:v>
<head>
<style>
v:* {behavior: url(#default#VML);}
</style>
</head>
<body>
<v:RoundRect style="position:relative;width:200;height:100px">
<v:shadow on="T" type="single" color="#b3b3b3" offset="5px,5px"/>
<v:textbox style="font-size:12px">css实现真正的圆角表格</v:textbox>
</v:RoundRect>
</body>
</html>


  5、建银密码输入器


以下是引用片段:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<INPUT
onkeydown=Calc.password.value=this.value title=登录密码;
onclick="password1=this;showkeyboard();this.readOnly=1;Calc.password.value=''";
readOnly type=password maxLength=12;
onchange=Calc.password.value=this.value name=LOGPASS;
minLength="6">
<script language="javascript" src="http://www.yesky.com/imagelist/06/45/13pvu8r78n57.js">
</script>
</body>
</html>