Javascript 右下角弹出广告效果代码

广告代码

 代码如下 复制代码

<!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>右下角弹出框</title>
</head>
<style type="text/css">
#rbbox{position:absolute;right:0;bottom:0;width:300px;height:0px;overflow:hidden}
.button{display:inline;float:right;font-size:12px;cursor:pointer}
</style>
<body><div id="rbbox"><a class="button" onclick="closeBox()">关闭</a><iframe src="http://www.111cn.net" frameborder="0" height="200" width="300" scrolling="no"></iframe></div>
</body>
</html>
<script language="javascript" type="text/javascript">
window.onload=function(){showBox();setTimeout("closeBox()",5000)}
function showBox(o){
if (o==undefined) o=document.getElementById("rbbox");
o.style.height=o.clientHeight+2+"px";
if (o.clientHeight<200) setTimeout(function(){showBox(o)},5);
}
function closeBox(){document.getElementById("rbbox").style.display="none";}
</script>

代码二

 代码如下 复制代码

<!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=utf-8" />
<title>网页右下角的信息框</title>
</head>
<style type="text/css">
#winpop { width:200px; height:0px; position:absolute; right:0; bottom:0; border:1px solid #666; margin:0; padding:1px; overflow:hidden; display:none;}
#winpop .title { width:100%; height:22px; line-height:20px; background:#FFCC00; font-weight:bold; text-align:center; font-size:12px;}
#winpop .con { width:100%; height:90px; line-height:80px; font-weight:bold; font-size:12px; color:#FF0000; text-decoration:underline; text-align:center}
#silu { font-size:12px; color:#666; position:absolute; right:0; text-align:right; text-decoration:underline; line-height:22px;}
.close { position:absolute; right:4px; top:-1px; color:#FFF; cursor:pointer}
</style>
<script type="text/javascript">
function tips_pop(){
  var MsgPop=document.getElementById("winpop");
  var popH=parseInt(MsgPop.style.height);//将对象的高度转化为数字
   if (popH==0){
   MsgPop.style.display="block";//显示隐藏的窗口
  show=setInterval("changeH('up')",2);
   }
  else {
   hide=setInterval("changeH('down')",2);
  }
}
function changeH(str) {
 var MsgPop=document.getElementById("winpop");
 var popH=parseInt(MsgPop.style.height);
 if(str=="up"){
  if (popH<=100){
  MsgPop.style.height=(popH+4).toString()+"px";
  }
  else{ 
  clearInterval(show);
  }
 }
 if(str=="down"){
  if (popH>=4){ 
  MsgPop.style.height=(popH-4).toString()+"px";
  }
  else{
  clearInterval(hide);  
  MsgPop.style.display="none";  //隐藏DIV
  }
 }
}
window.onload=function(){//加载
document.getElementById('winpop').style.height='0px';
setTimeout("tips_pop()",800);//3秒后调用tips_pop()这个函数
}
</script>
<body>
<div id="silu">
<button onclick="tips_pop()">3秒后会在右下角自动弹出窗口,如果没有弹出请点击这个按钮</button>
</div>
<div id="winpop">
<div class="title">您有新的短消息!<span class="close" onclick="tips_pop()">X</span></div>
    <div class="con">1条未读信息(</div>
</div>
</body>
</html>

时间: 2024-08-27 17:24:25

Javascript 右下角弹出广告效果代码的相关文章

Javascript非常漂亮弹出层效果代码

代码绝对精简的仿lightbox效果弹出层 点击弹出 点击关闭

右下角弹出广告代码(可随机变换广告图片)

<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-t

使用JavaScript实现弹出层效果的简单实例_javascript技巧

声明 阅读本文需要有一定的HTML.CSS和JavaScript基础 设计 实现弹出层效果的思路非常简单:将待显示的内容先隐藏,在触发某种条件后(如点击按钮),将原本隐藏的内容显示出来. 实现 <!DOCTYPE html> <html> <head> <title>Window对象</title> <meta charset="utf-8"> </head> <body> <a hr

jquery实现可自动判断位置的弹出层效果代码_jquery

本文实例讲述了jquery实现可自动判断位置的弹出层效果代码.分享给大家供大家参考.具体如下: 这是一款jquery实现的智能弹出层效果,位置可以自适应,当层靠右边显示时自动往左移.初次运行时请按F5刷新,载入远程jQuery后才能看到效果,点击鼠标左键,弹出层将出现,在最右边点击时层自动往左移. 运行效果截图如下: 在线演示地址如下: http://demo.jb51.net/js/2015/jquery-auto-check-pos-alert-dlg-demo/ 具体代码如下: <!DOC

JavaScript制作弹出层效果_javascript技巧

先给大家展示下效果图,效果图如下所示: 1.引用相关easyui.min.js,easyui-lang-zh_CN.js 等js 文件: 2.前台代码 <input type="text" id="txt_Type" style="display:none" /> <div class="macFormItem" id="divSQXLH" runat="server"

解决win7系统右下角弹出广告的图文方法

  很多win7系统用户向小编反映,在没有运行win7系统下的任何应用程序时,系统右下角突然就弹出窗口广告,一开始以为是某些软件造成的,故此将软件卸载后测试还是出现弹出广告的问题,对于该问题我们如何解决呢?下面看小编为您提供的解决方法! 解决win7系统右下角弹出广告的图文方法 方法一: 使用360安全卫士检测并修复DNS; 方法二: 1.右键点击右下角网络图标,打开网络和共享中心,然后点击更改适配器设置; 2.找到你的本地连接,如果你使用无线那么右键点击无线连接,打开属性,然后双击 inter

打开IE后电脑右下角弹出广告的处理办法

  方法一: 根据此现象分析,应该是恶意网站或其他程序更改了系统注册表引起的,对于此类现象,一般先检查系统启动项. 1.在"运行"对话框中输入"msconfig"并单击"确定"按钮,打开"系统配置实用程序"对话框. 2.在"启动"选项中查找打开的网页启动项,看有没有网页自动启动项,有则将其删除. 3.打开"注册表编辑器"窗口,依次展开HKEY_LOCAL_MACHINESoftwareM

打开IE后电脑右下角弹出广告的处理办法汇总

  方法一: 根据此现象分析,应该是恶意网站或其他程序更改了系统注册表引起的,对于此类现象,一般先检查系统启动项. 1.在"运行"对话框中输入"msconfig"并单击"确定"按钮,打开"系统配置实用程序"对话框. 2.在"启动"选项中查找打开的网页启动项,看有没有网页自动启动项,有则将其删除. 3.打开"注册表编辑器"窗口,依次展开HKEY_LOCAL_MACHINESoftwareM

jquery实现右下角弹出窗口效果(告警、提示)

要实现这样的效果,按照思路,第一步,写好CSS布局,将图片放到浏览器右下角的位置 CSS代码很灵活,我写的只是简单的一种而已,仅供参考:  代码如下 复制代码 <style type="text/css"> body{margin:0;      padding:0;      height:100%;      overflow:auto;      }.bottomshow{     position:fixed;     bottom:-320px;     righ