The lower right corner of the page pop-up prompt box sample code JS version

Source: Internet
Author: User
Tags setinterval
Bottom right corner pop-up prompt box presumably we will not be unfamiliar with it, this article simple for everyone to achieve a, specific code as follows, the need for friends can refer to the Copy CodeThe code is as follows:


<%@ page language= "java" import= "java.util.*" pageencoding= "UTF-8"%>
<%
String path = Request.getcontextpath ();
String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";
%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Untitled Document </title>
<style type= "Text/css" >
* {margin:0px;padding:0px;}
html,body {height:100%;}
body {font-size:14px; line-height:24px;}
#tip {
Position:absolute;
right:0px;
bottom:0px;
height:0px;
width:180px;
border:1px solid #CCCCCC;
Background-color: #eeeeee;
padding:1px;
Overflow:hidden;
Display:none;
font-size:12px;
Z-index:10;
}
#tip p {padding:6px;}
#tip H1, #detail H1 {
font-size:14px;
height:25px;
line-height:25px;
Background-color: #0066CC;
Color: #FFFFFF;
padding:0px 3px 0px 3px;
Filter:alpha (opacity=100);
}
#tip H1 A, #detail H1 a {
Float:right;
Text-decoration:none;
Color: #FFFFFF;
}
#shadow {
Position:absolute;
width:100%;
height:100%;
Background-color: #000000;
Z-index:11;
Filter:alpha (opacity=70);
Display:none;
Overflow:hidden;
}
#detail {
width:500px;
height:200px;
BORDER:3PX double #ccc;
Background-color: #FFFFFF;
Position:absolute;
z-index:30;
Display:none;
left:30%;
top:30%
}
</style>
<script type= "Text/javascript" >
var handle;
function Start ()
{
var obj = document.getElementById ("Tip");
if (parseint (obj.style.height) ==0)
{obj.style.display= "block";
Handle = SetInterval ("Changeh (' Up ')", 2);
}else
{
Handle = SetInterval ("Changeh (' Down ')", 2)
}
}
function Changeh (str)
{
var obj = document.getElementById ("Tip");
if (str== "up")
{
if (parseint (obj.style.height) >200)
Clearinterval (handle);
Else
Obj.style.height= (parseint (obj.style.height) +8). ToString () + "px";
}
if (str== "down")
{
if (parseint (obj.style.height) <8)
{clearinterval (handle);
Obj.style.display= "None";
}
Else
Obj.style.height= (parseint (obj.style.height) -8). ToString () + "px";
}
}
function Showwin ()
{
document.getElementsByTagName ("HTML") [0].style.overflow = "hidden";
Start ();
document.getElementById ("Shadow"). style.display= "Block";
document.getElementById ("detail"). style.display= "Block";
}
function Recover ()
{
document.getElementsByTagName ("HTML") [0].style.overflow = "Auto";
document.getElementById ("Shadow"). Style.display= "None";
document.getElementById ("detail"). style.display= "None";
}
</script>
<body onload= "document.getElementById" (' Tip '). style.height= ' 0px ' >
<div id= "Shadow" > </div>
<div id= "Detail" >
</div>
<div id= "Tip" >
</body>
<script language= "JavaScript" >
Window.attachevent ("onload", MyTimer); Bind to onload Event
function MyTimer () {
Start ();
Window.settimeout ("MyTimer ()", 6000);/Set cycle time
}
</script>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.