在网页中实现伸缩式信息提示

来源:互联网 发布:体细胞重编程 编辑:程序博客网 时间:2024/04/30 19:02

    在网页中如何实现信息提示呢,就像有些网站你登录上去后,会在右下角产生一个自下而上打开的信息提示一样,其实实现它很简单。用下面的代码看看效果吧。 

<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META http-equiv=pragma content=no-cache>
<style>
#menu{position:absolute;bottom:-100;width:150;right:0;border:0pt solid black;
background-color:#CCCCCC;layer-background-color:no;font: 9pt/20pt "宋体";}
</style>


</HEAD>

<BODY onload="pull();" style="overflow:hidden;">

<script language="javascript">
document.write("<div id=/"menu/" style=/"bottom:-100;cursor:hand/" onclick=/"hidden();/">&nbsp;&nbsp;消息提示<br>&nbsp;&nbsp;发现有未处理的网吧消息<br>&nbsp;&nbsp;关闭<br></div>");

if (document.all){
themenu=document.all.menu.style
}else{
themenu=document.layers.menu
}

function pull(){
pullit=setInterval("pullengine()",100)
}

function hidden(){
themenu.pixelBottom = -100;
}
function pullengine(){
if (document.all&&themenu.pixelBottom<0)
themenu.pixelBottom+=5
else if(document.layers&&themenu.bottom<0)
themenu.bottom+=5
else if (window.pullit)
clearInterval(pullit)
}
</script>
</BODY>
</HTML>