javascript

位置:IT落伍者 >> javascript >> 浏览文章

页面右下角弹出提示框示例代码js版


发布日期:2018年07月28日
 
页面右下角弹出提示框示例代码js版
右下角弹出提示框想必大家不会陌生吧本文简单的为大家实现一个具体代码如下有需求的朋友可以参考下复制代码 代码如下:


<%@ page language="java" import="javautil*" pageEncoding="UTF"%>
<%
String path = requestgetContextPath();
String basePath = requestgetScheme()+"://"+requestgetServerName()+":"+requestgetServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "//WC//DTD XHTML Transitional//EN" "
<html xmlns="
<head>
<meta httpequiv="ContentType" content="text/html; charset=gb" />
<title>无标题文档</title>
<style type="text/css">
* {margin:px;padding:px;}
htmlbody { height:%;}
body { fontsize:px; lineheight:px;}
#tip {
position: absolute;
right: px;
bottom: px;
height: px;
width: px;
border: px solid #CCCCCC;
backgroundcolor: #eeeeee;
padding: px;
overflow:hidden;
display:none;
fontsize:px;
zindex:;
}
#tip p { padding:px;}
#tip h#detail h {
fontsize:px;
height:px;
lineheight:px;
backgroundcolor:#CC;
color:#FFFFFF;
padding:px px px px;
filter: Alpha(Opacity=);
}
#tip h a#detail h a {
float:right;
textdecoration:none;
color:#FFFFFF;
}
#shadow {
position:absolute;
width:%;
height:%;
backgroundcolor:#;
zindex:;
filter: Alpha(Opacity=);
display:none;
overflow:hidden;
}
#detail {
width:px;
height:px;
border:px double #ccc;
backgroundcolor:#FFFFFF;
position:absolute;
zindex:;
display:none;
left:%;
top:%
}
</style>
<script type="text/javascript">
var handle;
function start()
{
var obj = documentgetElementById("tip");
if (parseInt(objstyleheight)==)
{ objstyledisplay="block";
handle = setInterval("changeH(up)");
}else
{
handle = setInterval("changeH(down)")
}
}
function changeH(str)
{
var obj = documentgetElementById("tip");
if(str=="up")
{
if (parseInt(objstyleheight)>)
clearInterval(handle);
else
objstyleheight=(parseInt(objstyleheight)+)toString()+"px";
}
if(str=="down")
{
if (parseInt(objstyleheight)<)
{ clearInterval(handle);
objstyledisplay="none";
}
else
objstyleheight=(parseInt(objstyleheight))toString()+"px";
}
}
function showwin()
{
documentgetElementsByTagName("html")[]styleoverflow = "hidden";
start();
documentgetElementById("shadow")styledisplay="block";
documentgetElementById("detail")styledisplay="block";
}
function recover()
{
documentgetElementsByTagName("html")[]styleoverflow = "auto";
documentgetElementById("shadow")styledisplay="none";
documentgetElementById("detail")styledisplay="none";
}
</script>
</head>
<body onload="documentgetElementById(tip)styleheight=px">
<div id="shadow"> </div>
<div id="detail">
</div>
<div  id="tip"><h><a href="javascript:void()"  onclick="start()">×</a>您有新消息</h><p><a  href="javascript:void()"  onclick="showwin()">点击这里查看详细</a></p></div>

</body>
</html>
<script language="JavaScript">
windowattachEvent("onload" myTimer); //绑定到onload事件
function myTimer() {
start();
windowsetTimeout("myTimer()");//设置循环时间
}
</script>

               

上一篇:浅析document.createDocumentFragment()与js效率

下一篇:js实现json数据行到列的转换