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="">
</script>
</body>
</html>
softkeyboard.js
//定义当前是否大写的状态
window.onload=
function()
{
password1=null;
initCalc();
}
var CapsLockValue=0;
var check;
function setVariables() {
tablewidth=630; // logo width, in pixels
tableheight=20; // logo height, in pixels
if (navigator.appName == "Netscape") {
horz=".left";
vert=".top";
docStyle="document.";
styleDoc="";
innerW="window.innerWidth";
innerH="window.innerHeight";
offsetX="window.pageXOffset";
offsetY="window.pageYOffset";
}
else {
horz=".pixelLeft";
vert=".pixelTop";
docStyle="";
styleDoc=".style";
innerW="document.body.clientWidth";
innerH="document.body.clientHeight";
offsetX="document.body.scrollLeft";
offsetY="document.body.scrollTop";
}
}
function checkLocation() {
if (check) {
objectXY="softkeyboard";
var availableX=eval(innerW);
var availableY=eval(innerH);
var currentX=eval(offsetX);
var currentY=eval(offsetY);
x=availableX-tablewidth+currentX;
//y=availableY-tableheight+currentY;
y=currentY;
evalMove();
}
setTimeout("checkLocation()",0);
}
function evalMove() {
//eval(docStyle + objectXY + styleDoc + horz + "=" + x);
eval(docStyle + objectXY + styleDoc + vert + "=" + y);
}