导航:首页 > 编程语言 > 左边浮动广告代码

左边浮动广告代码

发布时间:2025-01-19 00:12:26

『壹』 求网站两侧浮动广告代码

suspendcode="<DIVid=lovexin1style='Z-INDEX:10;LEFT:6px;POSITION:absolute;TOP:105px;width:100;height:300px;'><imgsrc='images/close.gif'onClick='javascript:window.hide()'width=颼'height=ཊ'border=Ɔ'vspace=Ɖ'alt='关闭对联广告汪慎'><EMBEDsrc='images/4rr.swf'quality=highWIDTH=100HEIGHT=300TYPE='application/x-shockwave-flash'id=adwmode=opaque></EMBED></DIV>"

document.write(suspendcode);

suspendcode="<则友DIVid=lovexin2style='Z-INDEX:10;LEFT:896px;POSITION:absolute;TOP:105px;width:100;height:300px;'><imgsrc='images/close.gif'onClick='javascript:window.hide()'width=颼'height=ཊ'border=Ɔ'vspace=Ɖ'alt='关闭对联广告'><EMBEDsrc='images/4rr.swf'quality=highWIDTH=100HEIGHT=300TYPE='application/x-shockwave-flash'id=adwmode=opaque></EMBED></DIV>孙陵槐"

document.write(suspendcode);

//flash格式调用方法

//<EMBEDsrc='flash.swf'quality=highWIDTH=100HEIGHT=300TYPE='application/x-shockwave-flash'id=adwmode=opaque></EMBED>

lastScrollY=0;

functionheartBeat(){

diffY=document.body.scrollTop;

percent=.3*(diffY-lastScrollY);

if(percent>0)percent=Math.ceil(percent);

elsepercent=Math.floor(percent);

document.all.lovexin1.style.pixelTop+=percent;

document.all.lovexin2.style.pixelTop+=percent;

lastScrollY=lastScrollY+percent;

}

functionhide()

{

lovexin1.style.visibility="hidden";

lovexin2.style.visibility="hidden";

}

window.setInterval("heartBeat()",1);

『贰』 如何插入网页左侧插入浮动广告代码

<DIV id=img1 style="Z-INDEX: 10; LEFT: 2px; WIDTH: 59px; POSITION: absolute; TOP: 43px; HEIGHT: 50px;
visibility: visible;"><a href="http://www.knowsky.com" target="_blank"><img src="images/fudong.jpg" width="150" height="100" border="0"></a></DIV>
<script >
var xPos = 900;
var yPos = 500;
var step = 1;
var delay = 30;
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
img1.style.top = yPos;
function changePos()
{
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = img1.offsetHeight;
Woffset = img1.offsetWidth;
img1.style.left = xPos + document.body.scrollLeft;
img1.style.top = yPos + document.body.scrollTop;
if (yon)
{yPos = yPos + step;}
else
{yPos = yPos - step;}
if (yPos < 0)
{yon = 1;yPos = 0;}
if (yPos >= (height - Hoffset))
{yon = 0;yPos = (height - Hoffset);}
if (xon)
{xPos = xPos + step;}
else
{xPos = xPos - step;}
if (xPos < 0)
{xon = 1;xPos = 0;}
if (xPos >= (width - Woffset))
{xon = 0;xPos = (width - Woffset); }
}

function start()
{
img1.visibility = "visible";
interval = setInterval('changePos()', delay);
}
function pause_resume()
{
if(pause)
{
clearInterval(interval);
pause = false;}
else
{
interval = setInterval('changePos()',delay);
pause = true;
}
}
start();</script>

『叁』 左侧浮动广告代码跟随页面滚动,急急急!跪求!!!!

用DOCTYPE声明文档类型,然后加如下代码:
<div id="left_layer" style="position:fixed; top:40px; left:0px;">
<img src="图片"><br>
<a href="javascript:;" onclick="javascript:document.getElementById('left_layer').style.display='none';">关闭</a>
</div>
如果有共用的页眉页脚,或是模版专页之内的,加进去就可以属显示在所有页了.如果没有,就一页页的加吧.

『肆』 悬浮广告代码,带链接的

这是左侧漂浮的广告代码

<SCRIPT FOR=window EVENT=onload LANGUAGE="javascript">

initAd();//载入页面后,调用函数initAd()

</SCRIPT>

<script language="javascript">

<!--

function initAd() {

document.all.AdLayer.style.posTop = -200;

//设置onLoad事件激发以后,广告层相对于固定后的y方向位置

document.all.AdLayer.style.visibility = 'visible'//设置层为可见

MoveLayer('AdLayer');//调用函数MoveLayer()

}

function MoveLayer(layerName) {

var x = 0;//浮动广告层固定于浏览器的x方向位置

var y = 408;//浮动广告层固定于浏览器的y方向位置

var diff = (document.body.scrollTop + y - document.all.AdLayer.style.posTop)*.90;

var y = document.body.scrollTop + y - diff;

eval("document.all." + layerName + ".style.posTop = y");

eval("document.all." + layerName + ".style.posright = x");//移动广告层

setTimeout("MoveLayer('AdLayer');", 0);//设置20毫秒后再调用函数MoveLayer()

}

//-->

</script>

<div id=AdLayer style='position:absolute; width:61px; height:59px; z-index:20; visibility:hidden;; left: 0px; top: 100px'> <a href="#"><img border="0" src="images/jixiangwu.gif" width="81" height="88"></a></div>

『伍』 请问 网页两边浮动广告代码div漂浮广告代码怎样写

左栏浮动广告
<script language=javascript>var specialcode="<DIV id=searchspe style='Z-INDEX: <script language=javascript>var specialcode="<DIV id=searchspe style='Z-INDEX: 100; right: 1px; POSITION: absolute; TOP: 180px;'><TABLE cellSpacing=0 cellPadding=0 width=150 style='border-left:1px solid #2E6287;border-top:1px solid #2E6287;border-right:1px solid #2E6287;font-size:12px;color:#ffffff; border-bottom-color:#2E6287; border-bottom-width:1px'><TR bgcolor=#2E6287><TD height=20> 推荐↓</TD><TD style='CURSOR: hand' onclick=searchspe.style.visibility='hidden' width=30>关 闭</TD></TR></TABLE><table border='1' width='150' height='500' bordercolor='#2E6287'><tr><td>广告内容</td></tr></table></DIV>";document.write(specialcode);lastScrollY=0;function heartBeat0(){diffY=document.body.scrollTop;percent=.1*(diffY-lastScrollY);if(percent>0)percent=Math.ceil(percent);else percent=Math.floor(percent);document.all.searchspe.style.pixelTop+=percent;lastScrollY=lastScrollY+percent;}window.setInterval("heartBeat0()",1);</script>

右栏浮动广告
<script language=javascript>var specialcode="<DIV id=searchspe style='Z-INDEX: 100; left: 1px; POSITION: absolute; TOP: 50px;'><TABLE cellSpacing=0 cellPadding=0 width=360 style='border-left:1px solid #333333;border-top:1px solid #333333;border-right:1px solid #333333;font-size:12px;color:#ffffff'><TR bgcolor=#2E6287><TD height=20> 推荐↓</TD><TD style='CURSOR: hand' onclick=searchspe.style.visibility='hidden' width=30>关 闭</TD></TR></TABLE><table border='1' width='150' id='table1' bordercolor='#2E6287' height='500'><tr><td>广告内容</td></tr></table></DIV>";document.write(specialcode);lastScrollY=0;function heartBeat0(){diffY=document.body.scrollTop;percent=.1*(diffY-lastScrollY);if(percent>0)percent=Math.ceil(percent);else percent=Math.floor(percent);document.all.searchspe.style.pixelTop+=percent;lastScrollY=lastScrollY+perce

『陆』 求网站左右空白地方悬浮对联广告代码,可以上下移动的那种

先在你的网站主目录建立js文件,再建立一个JS文件(如ad-01.js)
打开文本将下面代码复制到其中,保存格式为js
function initEcAd() {
document.all.AdLayer1.style.posTop = -200;
document.all.AdLayer1.style.visibility = 'visible'
document.all.AdLayer2.style.posTop = -200;
document.all.AdLayer2.style.visibility = 'visible'
MoveLeftLayer('AdLayer1');
MoveRightLayer('AdLayer2');
}
function MoveLeftLayer(layerName) {
var x = 5;
var y = 100;// 左侧广告距离页首高度
var diff = (document.body.scrollTop + y - document.all.AdLayer1.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = parseInt(y)");
eval("document.all." + layerName + ".style.posLeft = x");
setTimeout("MoveLeftLayer('AdLayer1');", 20);
}
function MoveRightLayer(layerName) {
var x = 5;
var y = 100;// 右侧广告距离页首高度
var diff = (document.body.scrollTop + y - document.all.AdLayer2.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = y");
eval("document.all." + layerName + ".style.posRight = x");
setTimeout("MoveRightLayer('AdLayer2');", 20);
}

document.write("<div id=AdLayer1 style='position: absolute;visibility:hidden;z-index:1'><a href='http://你链接的网址' target='_blank'><img src=你链接的图片 border='0'></a></div>"
+"<div id=AdLayer2 style='position: absolute;visibility:hidden;z-index:1'><a href='http://你链接的网址' target='_blank'><img src=你链接的图片 border='0'></a></div>");
initEcAd()

// JavaScript Document

还没结束呢,,然后将 <script src="js/ad-01.js" language="JavaScript"></script>放在body中。就OK了,还不明白就加我QQ:9142673。我指导你。。

阅读全文

与左边浮动广告代码相关的资料

热点内容
51单片机动画教程 浏览:582
有没有什么开空调的网站 浏览:492
清除王者数据是什么意思 浏览:131
用代码如何创建数据库 浏览:478
国外影视教程 浏览:38
iphone自动关机开不了 浏览:107
怎么制作配音网站 浏览:375
电脑的编程从哪里进去 浏览:367
苹果电脑无法输入密码 浏览:197
淘宝推广程序怎么删除 浏览:20
程序员英文怎么说 浏览:600
微信群色聊天记录图片 浏览:679
树莓派java开发 浏览:173
苹果往安卓转移数据的代码在哪里 浏览:113
win10usable 浏览:629
网站空间怎么开启ip访问 浏览:943
找不到指定的素材文件 浏览:429
笔记本怎么拷文件夹里 浏览:729
在文件管理中找不到下载好的音频 浏览:627
linuxu盘文件挂载 浏览:105

友情链接