HTML滤镜效果

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>alpha滤镜</title>
</head>
<body>
<div id="Layer1" style="position:absolute;visibility:hidden;background-color:#333333;z-index:0;filter:Alpha(opacity=0);opacity:0.0;top:0px;left:0px;width:100%;height:100;">
<p align="center"><input type="button" name="Submit" value="alpha滤镜按钮" οnclick="alpha0()" /></p>
<iframe id="coveriframe" frameborder="0" width="100%" height="100" src="about:blank"></iframe>
</div>
<table width="500" border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#000000">
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
<tr>
<td align="center"><input type="button" name="Submit" value="alpha滤镜按钮" οnclick="alpha50()" /></td>
</tr>
<tr>
<td align="center"><input type="submit" name="Submit3" value="提交" /></td>
</tr>
</form>
</table>
</body>
</html>
<script language="javascript">
var coveriframe;
coveriframe = document.getElementById("coveriframe").contentWindow;
coveriframe.document.open();//打开文档流
coveriframe.document.writeln('<html><head>');
coveriframe.document.writeln("</head><body></body></html>");
coveriframe.document.body.style.backgroundColor="#333333";
coveriframe.document.close();
if(document.body.scrollHeight>window.screen.availHeight){
document.getElementById("coveriframe").height=document.body.scrollHeight;
}else{
document.getElementById("coveriframe").height=window.screen.availHeight;
}

function alpha50(){
opa=Number(document.getElementById("Layer1").style.opacity);
opa=opa+(5/100);
document.getElementById("Layer1").style.visibility="visible";
document.getElementById("Layer1").style.filter="Alpha(opacity="+opa*100+")";
document.getElementById("Layer1").style.opacity=opa;
if(opa<=50/100){
setTimeout("alpha50()",100);
}
}
function alpha0(){
opa=Number(document.getElementById("Layer1").style.opacity);
opa=opa-(5/100);
document.getElementById("Layer1").style.filter="Alpha(opacity="+opa*100+")";
document.getElementById("Layer1").style.opacity=opa;
if(opa>=0){
setTimeout("alpha0()",100);
}else{
document.getElementById("Layer1").style.visibility="hidden";
}
}
</script>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值