>

js完毕网址最上部可关闭的变动广告条代码,js浮

- 编辑:乐百家599手机首页 -

js完毕网址最上部可关闭的变动广告条代码,js浮

js实现网址最上面可关闭的改造广告条代码,js浮动广告

本文实例呈报了js完成网址最上部可关闭的生成广告条。分享给大家供我们参谋。具体如下:

那是一款广告条代码,平常生成在网址最上方,可关闭,设计唯美简洁,带关闭开关,自适应网页宽度,色调明了,相信有那几个爱人会欣赏的.

运行效果截图如下:

乐百家前段 1

在线演示地址如下:

切实代码如下:

<html>
<head>
<title>网站页首可关闭广告条</title>
<style type="text/css">
<!--
body { margin: 0px;padding: 0px;text-align: center;}
TD {FONT-SIZE: 12px; COLOR: #333;}
#topadv {BORDER-BOTTOM: #e2e2e2 1px solid;}
-->
</style>
</head>
<body>
<SCRIPT>
 function floatadv(){
  document.getElementById("topadv").style.display="none";
 }
</SCRIPT>
<DIV id=topadv>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
 <tr>
 <td width="4%" height="30" align="center"><img src="images/kids.gif" width="15" height="14"></td>
 <td width="82%"><a href="http://www.bkjia.com/">帮客之家</a>是国内专业的网站建设资源、脚本编程学习类网站,提供asp、php、asp.net、javascript、jquery、vbscript、dos批处理、网页制作、网络编程、网站建设等编程资料。</td>
 <td width="14%" align="right"><a style="CURSOR: hand" onClick=floatadv()><img 
 src="images/close.gif" width=84 height=11 hspace="6" border=0></a></td>
 </tr>
</table>
</DIV>
</body>
</html>

企望本文所述对我们的javascript程序设计有所帮助。

乐百家前段, 本文实例陈诉了js达成网址最最上部可关闭的退换广告条。分享给大家供大家参考。具...

那是一款广告条代码,常常变化在网址最上面,可关闭,设计唯美简洁,带关闭按键,自适应网页宽度,色调明了,相信有大多仇人会欣赏的.

您大概感兴趣的篇章:

  • js落成随显示屏滚动的带缓冲效果的右下角广告代码
  • JS右下角广告窗口代码(可裁减、打开及停业)
  • js完成网址最最上部可关闭的成形广告条代码
  • js完毕拉幕效果的广告代码
  • JS完成弹性漂浮效果的广告代码
  • JS完毕可点击张开与关闭的左边广告代码
  • js漂浮广告完结代码
  • js完毕轻巧的左右两侧牢固广告效应实例
  • JS达成先出示大图后自动接收呈现小图的广告代码

如上正是本文的全体内容,希望对我们的就学抱有扶助,也意在大家多多支持脚本之家。

<html>
<head>
<title>网站页首可关闭广告条</title>
<style type="text/css">
<!--
body { margin: 0px;padding: 0px;text-align: center;}
TD {FONT-SIZE: 12px; COLOR: #333;}
#topadv {BORDER-BOTTOM: #e2e2e2 1px solid;}
-->
</style>
</head>
<body>
<SCRIPT>
 function floatadv(){
  document.getElementById("topadv").style.display="none";
 }
</SCRIPT>
<DIV id=topadv>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
 <tr>
 <td width="4%" height="30" align="center"><img src="images/kids.gif" width="15" height="14"></td>
 <td width="82%"><a href="//www.jb51.net/">脚本之家</a>是国内专业的网站建设资源、脚本编程学习类网站,提供asp、php、asp.net、javascript、jquery、vbscript、dos批处理、网页制作、网络编程、网站建设等编程资料。</td>
 <td width="14%" align="right"><a style="CURSOR: hand" onClick=floatadv()><img 
 src="images/close.gif" width=84 height=11 hspace="6" border=0></a></td>
 </tr>
</table>
</DIV>
</body>
</html>
<!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>
<script language="javascript">
var $ = function (d){return document.getElementById(d)};
var CLS={
create: function() {
return function() {
this.$ADD = function (fn){CLS.add(this,fn)};
this.init.apply(this, arguments);
}
},
add:function (obj,fn){
fn.apply(obj,arguments);
},
enterFrame:function (){
this.onEnterFrame=function (){};
this.$PLAY = function (g){
this.enterFrameP = this.enterFrameP || 10;
this.CLStimeIndex = CLS.ontimes.length;
CLS.ontimes.push(this);
window.clearTimeout(this.enterFrameTimeout);
window.clearInterval(this.enterFrameInterval);
if(g)this.enterFrameTimeout = window.setTimeout('CLS.ontimes[' this.CLStimeIndex '].enterFrameInterval=window.setInterval("CLS.ontimes[' this.CLStimeIndex '].onEnterFrame()",' this.enterFrameP ')',parseInt(g*1000));
else this.enterFrameInterval = window.setInterval("CLS.ontimes[" this.CLStimeIndex "].onEnterFrame()",this.enterFrameP);
}
this.$STOP = function (){
window.clearInterval(this.enterFrameInterval);
}
this.$SET = function (p){
this.enterFrameP = p;
}
},
ontimes:new Array()
};
CLS.Marquee = CLS.create();
CLS.Marquee.prototype = {
init:function (button,box,speed){
this.box = $(box);
this.tit = $(button)
this.kong = $("kong");
this.onOpen = true;
this.show = false;
this.time = 0;
this.speed = speed;
this.kong.style.height = this.box.offsetHeight  "px";
this.Maxw = this.box.offsetWidth-this.tit.offsetWidth;
this.box.style.right = -this.box.offsetWidth   "px";
this.boxTop = this.kong.offsetTop;
var _t = this;
this.tit.onclick = function (){
this.show = true;
if(_t.onOpen){
_t.onEnterFrame = _t.close;
_t.onOpen = false;
}else{
_t.onEnterFrame = _t.open;
_t.onOpen = true;
}
_t.$PLAY();
};
this.$ADD(CLS.enterFrame);
this.onEnterFrame = this.open;
this.$PLAY();
},
open:function(){
this.tit.innerHTML = "-";
var _r = parseInt(this.box.style.right);
var _b = (0 - _r)/30;
this.box.style.right = (_r   _b)  "px";
this.kong.style.top = (document.documentElement.scrollTop   this.boxTop)  "px";
if(_b==0 && !this.show){
this.time  =10;
if(this.time>=this.speed*1000){
this.show = true;
this.onOpen = false;
this.$STOP();
this.onEnterFrame = this.close;
this.$PLAY(); 
}
} 
},
close:function (){
this.tit.innerHTML = " ";
var _r = parseInt(this.box.style.right);
var _b = (-this.Maxw - _r)/5;
this.box.style.right = Math.round(_r   _b)  "px";
this.kong.style.top = (document.documentElement.scrollTop   this.boxTop)  "px";
}
};
window.onload = function (){
setTimeout(function(){new CLS.Marquee("tit","abc",10)},3000);
//tit是点击按钮的Id ,abc是浮动块的ID,10是显示时长
};
</script>
<style type="text/css">
<!--
#abc {
border: 1px solid #003399;
position: absolute;
height: 150px;
width: 220px;
right: -100%;
}
#abc #tit {
background-color: #0066FF;
position: relative;
height: 100%;
width: 20px;
color: #FFFFFF;
text-align: center;
float: left;
}
#kong {
position: absolute;
width: 100%;
top: 100px;
overflow: hidden;
top: 100px;
right: 0px;
}
.right {
float: right;
width: 190px;
padding: 5px;
}
-->
</style>
</head>
<body style="margin:0px;">
<!--浮动框外面套一层,防止出现横向滚动条-->
<div id="kong">
<!--浮动框-->
<div id="abc">
<div id="tit">-</div>
<div class="right">
<a href="/">网页上从右边缓缓弹出的广告框效果</a></div>
</div>
</div>
右侧广告3秒后弹出
</body>
</html>
<html>
<title>左右两侧浮动广告</title>
<head>
</head>
<body>
<table style="background-color:#EEEEE2;width:1024px;height:2000px;t" align="center">
 <tr><td> </td></tr>
</table>
<SCRIPT LANGUAGE="JavaScript">
<!--
 var showad = true;
 var Toppx = 60; //上端位置
 var AdDivW = 100; //宽度
 var AdDivH = 300; //高度
 var PageWidth = 800; //页面多少宽度象素下正好不出现左右滚动条
 var MinScreenW = 1024; //显示广告的最小屏幕宽度象素
 var ClosebuttonHtml = '<div align="right" style="position: absolute;top:0px;right:0px;margin:2px;padding:2px;z-index:2000;"><a href="javascript:;" rel="external nofollow" rel="external nofollow" mce_href="javascript:;" rel="external nofollow" rel="external nofollow" onclick="hidead()" style="color:red;text-decoration:none;font-size:12px;" mce_style="color:red;text-decoration:none;font-size:12px;">关闭</a></div>'
 var AdContentHtml = '<div align="center" style="color:green;font-size:23pt;font-family:黑体;" mce_style="color:green;font-size:23pt;font-family:黑体;"><br><br>广告</div>';
 document
  .write('<div id="Javascript.LeftDiv" style="position: absolute;border: 1px solid #336699;background-color:#EEEEE2;z-index:1000;width:' AdDivW 'px;height:' AdDivH 'px;top:-1000px;word-break:break-all;display:none;">'
     ClosebuttonHtml
     '<div>'
     AdContentHtml
     '</div></div>');
 document
  .write('<div id="Javascript.RightDiv" style="position: absolute;border: 1px solid #336699;background-color:#EEEEE2;z-index:1000;width:' AdDivW 'px;height:' AdDivH 'px;top:-1000px;word-break:break-all;display:none;">'
     ClosebuttonHtml
     '<div>'
     AdContentHtml
     '</div></div>');
 function scall() {
 if (!showad) {
  return;
 }
 if (document.body.clientWidth < MinScreenW) {
  //alert("临时提示:/n/n显示器分辨率宽度小于"   MinScreenW   ",不显示广告");
  showad = false; 
  document.getElementById("Javascript.LeftDiv").style.display = "none";
  document.getElementById("Javascript.RightDiv").style.display = "none";
  return;
 }
 var Borderpx =( ((window.screen.width - PageWidth) / 2 - AdDivW) / 2 );
 document.getElementById("Javascript.LeftDiv").style.display = "";
 document.getElementById("Javascript.LeftDiv").style.top = document.body.scrollTop
    Toppx;
 document.getElementById("Javascript.LeftDiv").style.left = document.body.scrollLeft
    Borderpx;
 document.getElementById("Javascript.RightDiv").style.display = "";
 document.getElementById("Javascript.RightDiv").style.top = document.body.scrollTop
    Toppx;
 document.getElementById("Javascript.RightDiv").style.left = document.body.scrollLeft
    document.body.clientWidth
  - document.getElementById("Javascript.RightDiv").offsetWidth
  - Borderpx;
 }
 function hidead() {
 showad = false;
 document.getElementById("Javascript.LeftDiv").style.display = "none";
 document.getElementById("Javascript.RightDiv").style.display = "none";
 }
 window.onscroll = scall;
 window.onresize = scall;
 window.onload = scall;
//-->
</SCRIPT>
</body>
</html>

运作效果截图如下:

本文实例陈说了js完成从右向左缓缓浮出网页浮动层广告的点子。分享给大家供大家参谋。具体落实格局如下:

本文实例为大家享用了js完结左右转移广告呈现的具体代码,供大家参谋,具体内容如下

本文由乐百家前段发布,转载请注明来源:js完毕网址最上部可关闭的变动广告条代码,js浮