当前位置:首页 > 代码 > 正文

右侧浮动广告代码(js浮动广告)

admin 发布:2022-12-19 03:21 116


今天给各位分享右侧浮动广告代码的知识,其中也会对js浮动广告进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

右侧广告浮动代码。

" DIV id=floater1 style="Z-INDEX: 100; LEFT: 10px; VISIBILITY: visible; WIDTH: 100px; POSITION: absolute; TOP: 160px; height: 100px;"

左边的东西,可以是图片,表格

/DIV

DIV id=floater style="Z-INDEX: 100; RIGHT: 10px; VISIBILITY: visible; WIDTH: 100px; POSITION: absolute; TOP: 160px; left: 890px;"

右边的东西,可以是图片,表格

/DIV "

把下列代码存成文件包含到网页中就行了

menus.js的代码如下:

self.onError = null;

currentX = currentY = 0;

whichIt = null;

lastScrollX = 0; lastScrollY = 0;

NS = (document.layers) ? 1 : 0;

IE = (document.all) ? 1: 0;

function heartBeat(objectid) {

if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }

if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }

if(diffY != lastScrollY) {

percent = .1 * (diffY - lastScrollY);

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

else percent = Math.floor(percent);

if(IE) {

objectid = objectid.split(";");

for (i = 0; i objectid.length; i++) eval("document.all."+objectid[i]).style.pixelTop += percent;

}

if(NS) {

objectid = objectid.split(";");

for (i = 0; i objectid.length; i++) eval("document."+objectid[i]).top += percent;

}

lastScrollY = lastScrollY + percent;

}

if(diffX != lastScrollX) {

percent = .1 * (diffX - lastScrollX);

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

else percent = Math.floor(percent);

if(IE) {

objectid = objectid.split(";");

for (i = 0; i objectid.length; i++) eval("document.all."+objectid[i]).style.pixelLeft += percent;

}

if(NS) {

objectid = objectid.split(";");

for (i = 0; i objectid.length; i++) eval("document."+objectid[i]).left += percent;

}

lastScrollX = lastScrollX + percent;

}

}

if(NS || IE) action = window.setInterval("heartBeat(’floater;floater1’)", 2);

求一个右下角的漂浮广告代码?

右下角漂浮广告代码使用方法(一): 将以下代码以**.js文件形式保存,在模板中调用这个js文件即可

(备注该代码的图片大小为250*150 代码里面有参数自己看下就知道了)document.writeln("div id=\"qqaddiv\" style=\"position:absolute; z-index: 100;\" ");

document.writeln("a href=链接地址 target=_blankimg src=图片链接地址 border=0/a");

document.writeln("/div");

var bodyfrm = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;

var adst = document.getElementById("qqaddiv").style;

adst.top = ( bodyfrm.clientHeight - 150 ) + "px";

adst.left = ( bodyfrm.clientWidth - 250 ) + "px";

function moveR() {

adst.top = ( bodyfrm.scrollTop + bodyfrm.clientHeight - 150 ) + "px";

adst.left = ( bodyfrm.scrollLeft + bodyfrm.clientWidth - 250 ) + "px";

}

setInterval("moveR();", 80); 右下角漂浮广告代码使用方法(二): var qq_etewidth = 259;

var qq_eteheight = 158;

var qq_banner_filename = "广告图片链接地址";

var qq_gotoUrl = '广告链接地址';document.write("div id=eteUnionUpFloat style='margin:0px;padding-bottom:300px;z-index: 10;position:absolute;width:"+qq_etewidth+"px;height:"+qq_eteheight+"px;'")

document.write("a href='"+qq_gotoUrl+"' target='_blank'img src='"+qq_banner_filename+"' border='0' style='cursor: hand;' width='"+qq_etewidth+"' height='"+qq_eteheight+"'/a")

document.write("/div")

var bodyfrm = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;

var adst = document.getElementById("eteUnionUpFloat").style;

adst.top = ( bodyfrm.clientHeight - qq_eteheight ) + "px";

adst.left = ( bodyfrm.clientWidth - qq_etewidth ) + "px";

function moveR() {

adst.top = ( bodyfrm.scrollTop + bodyfrm.clientHeight - qq_eteheight ) + "px";

adst.left = ( bodyfrm.scrollLeft + bodyfrm.clientWidth - qq_etewidth ) + "px";

}

var objTimer=setInterval("moveR();", 100);function CloseX(){

adst.display='none';

}function ete_closediv()

{

document.getElementById('eteUnionUpFloat').style.visibility='hidden';

if(objTimer) window.clearInterval(objTimer)

}

求一个能用的右侧浮动JS代码

请将代码放置在head/head之间即可

script language="javascript"

suspendcode="DIV id=lovexin style='Z-INDEX: 10; LEFT: 850px; POSITION: absolute; TOP: 140px; width: 88px; height: 203px;'a href=''img src='../20080128/er_p.jpg' width='150' height='200' border='0'/a/DIV"

document.write(suspendcode);

lastScrollY=0;

function heartBeat(){

diffY=document.body.scrollTop;

percent=.1*(diffY-lastScrollY);

if(percent0)percent=Math.ceil(percent);

else percent=Math.floor(percent);

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

lastScrollY=lastScrollY+percent;

}

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

/script

代码说明:

1、加到左侧的时候,把left属性改为10就好;

2、TOP是控制这个浮动广告离上边的距离,可以根据自己的实际情况进行调整;

3、这里href='和这里img src='../20080128/er_p.jpg' 换成你想要的浮动广告的图片。其中这句src=../20080128/er_p.jpg' width='150' height='200'border='0' 中WIDTH=‘150’ height='200'是你浮动广告图片的宽和高。

关于右侧浮动广告代码和js浮动广告的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;

本文地址:http://ahzz.com.cn/post/1591.html


取消回复欢迎 发表评论:

分享到

温馨提示

下载成功了么?或者链接失效了?

联系我们反馈

立即下载