前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >JS网页顶部弹出可关闭广告图层

JS网页顶部弹出可关闭广告图层

作者头像
欢醉
发布2018-01-22 14:36:58
9.7K0
发布2018-01-22 14:36:58
举报
文章被收录于专栏:james大数据架构james大数据架构
代码语言: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=utf-8">
<meta name="keywords" content="站长,网页特效,js特效,js脚本,脚本,广告代码,zzjs,zzjs.net,sky,www.zzjs.net,站长特效 网" />
<meta name="description" content="www.zzjs.net,站长特效网,站长必备js特效及广告代码。全力打造一流网页特效站!" />
<title>网页特效 网页顶部弹出可关闭广告图层 站长特效网</title>
<style type="text/css">
#informationbar{
 position: fixed;
 left: 0;
 width: 100%;
 text-indent: 5px;
 padding: 5px 0;
 background-color: lightyellow;
 border-bottom: 1px solid black;
 font: bold 12px Verdana;
}
* html #informationbar{
 position: absolute;
 width: expression(document.compatMode=="CSS1Compat"? document.documentElement.clientWidth+"px": body.clientWidth+"px");
}
</style>
</head>
<body>
<a href="http://www.zzjs.net/">站长特效网</a>,以质量为核心,以实用为目的,打造一流网页特效站!zzjs.net,站长js特效。<hr>
<!--欢迎来到站长特效网,我们网站收集大量高质量js特效,提供许多广告代码下载,网址:www.zzjs.net,zzjs@msn.com,用.net打造靓站-->
<script type="text/javascript">
function informationbar(){
 this.displayfreq="always"
 this.content='<a href="javascript:informationbar.close()"><img src="/img/msgClose.gif" style="width:14px;height:14px;float:right;border:0;margin-right:5px;"></a>'
}//欢迎来到站长特x效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
informationbar.prototype.content_zzjs_net=function(data){
 this.content=this.content+data
 document.write('<div id="informationbar" style="top: -500px">'+this.content+'</div>')
}//欢迎来到站长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
informationbar.prototype.animatetoview=function(){
 var barinstance=this
 if (parseInt(this.barref.style.top)<0){
  this.barref.style.top=parseInt(this.barref.style.top)+5+"px"
  setTimeout(function(){barinstance.animatetoview()}, 50)
 }
 else{
  if (document.all && !window.XMLHttpRequest)
  this.barref.style.setExpression("top", 'document.compatMode=="CSS1Compat"?document.documentElement.scrollTop+"px":body.scrollTop+"px"')
 else
  this.barref.style.top=0
 }
}//欢迎来到站q长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
informationbar.close=function(){
 document.getElementById("informationbar").style.display="none"
 if (this.displayfreq=="session")
  document.cookie="infobarshown=1;path=/"
}//欢迎来到站长特效网,我们的网址是w ww.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
informationbar.prototype.setfrequency=function(type){
 this.displayfreq=type
}//欢迎来到站长特效网,我们的网址是www.zz js.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
informationbar.prototype.init_zzjsnet=function(){
 if (this.displayfreq=="session" && document.cookie.indexOf("infobarshown")==-1 || this.displayfreq=="always"){
  this.barref=document.getElementById("informationbar")
  this.barheight=parseInt(this.barref.offsetHeight)
  this.barref.style.top=this.barheight*(-1)+"px"
  this.animatetoview()
 }
}//欢迎来到站长特效.网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
window.onunload=function(){
 this.barref=null
}//欢迎来到站长特效网,我们的网址是ww.w.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
//Invocation code
var infobar=new informationbar()
infobar.content_zzjs_net('站长特效网,高质量网页特效代码,广告代码,js特效代码网站!以质量为核心,以实用为目的,打造一流网页特效站!www .zzjs .net')
infobar.init_zzjsnet()
</script>
</body>
</html>
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2014-04-03 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档