<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
function test(){
var ed = document.getElementById('errorXMsg');
ed.style.display = ''
var ch = document.documentElement.clientHeight;
var cw = document.documentElement.clientWidth;
ed.style.top = ch-8+'px';
ed.style.height='0px';
ed.style.left = cw-200 + 'px';
var tf = function(){
ed.style.height= parseInt(ed.style.height) + 5+'px';
ed.style.top= parseInt(ed.style.top)-5 + 'px';
if( parseInt(ed.style.top)<document.documentElement.clientHeight-80){
clearInterval(inter);
setTimeout(function(){ed.style.display = 'none'}, 2000);
}
}
var inter = setInterval(tf, 10);
}
</script>
</head>
<body>
<input type="button" onclick = 'test()' value='test' />
<div id="errorXMsg" style="position: absolute;width: 200px;height: 80px;background: yellow;display: none">
测试
</div>
</body>
</html>
一个右下角提示框的草稿
最新推荐文章于 2024-08-22 14:32:34 发布