DIV+CSS实现alt属性效果
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">div border属性
<title>⿏标提⽰</title>
<script language="JavaScript">
function seashowtip(tips,flag,iwidth){
var my_tips=ips;
if(flag){
my_tips.innerHTML=tips;
my_tips.style.display="";
my_tips.style.width=iwidth;
my_tips.style.left=event.clientX+10+document.body.scrollLeft;
my_p=event.clientY+10+document.body.scrollTop;
}
else
{
my_tips.style.display="none";
}
}
</script>
<style>
body{font-size:12px}
</style>
<div id=mytips ></div>
</head>
<body>
<form name="form1" method="post" action="">
⽤户名:
<input type="text" name="textfield" tips="*** 输⼊⽤户名." onmousemove=seashowtip(this.tips,1,150) onmo useout=seashowtip(this.tips,0,150)>
<br/>
密 码:
<input type="text" name="textfield2" tips="*** 输⼊密码." onmousemove=seashowtip(this.tips,1,150) onmo useout=seashowtip(this.tips,0,150)>
<br/>
验证码:
<input type="text" name="textfield3" tips="*** 输⼊验证码." onmousemove=seashowtip(this.tips,1,150) onm ouseout=seashowtip(this.tips,0,150)>
<input type="submit" name="Submit" value="提交">
</form>
</body>
</html>
代码较为简单,不作解释。注意DIV⾥⽤到了滤镜⾥的shadow属性,有阴影效果
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论