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

漂浮广告代码(悬浮广告代码)

admin 发布:2022-12-19 04:23 103


本篇文章给大家谈谈漂浮广告代码,以及悬浮广告代码对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

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

右下角漂浮广告代码使用方法(一): 将以下代码以**.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)

}

网站漂浮广告代码怎么写

script type="text/javascript"

function hidead()

{document.getElementById("ad").style.display="none";}

/script

div id="ad" style="position:absolute"

!--放广告代码--DIV onClick="hidead();" style="FONT-SIZE: 9pt; CURSOR: hand" align=right关闭广告×/DIV/div

script

var x = 80,y = 80

var xin = true, yin = true

var step = 1

var delay = 1

var obj=document.getElementById("ad")

function floatAD() {

var L=T=0

var R= document.body.clientWidth-obj.offsetWidth

var B = document.body.clientHeight-obj.offsetHeight

obj.style.left = x + document.body.scrollLeft

obj.style.top = y + document.body.scrollTop

x = x + step*(xin?1:-1)

if (x L) { xin = true; x = L}

if (x R){ xin = false; x = R}

y = y + step*(yin?1:-1)

if (y T) { yin = true; y = T }

if (y B) { yin = false; y = B }

}

var itl= setInterval("floatAD()", delay)

obj.onmouseover=function(){clearInterval(itl)}

obj.onmouseout=function(){itl=setInterval("floatAD()", delay)}

/script

js或者CSS带关闭的漂浮广告代码

htmlheadtitle固定在底部的漂浮广告/title/headbodyscript LANGUAGE='JavaScript'var ad_float_left_src="http:/images/logo.gif";var ad_float_left_url = "http:";var ad_float_left_type = "";document.ns = navigator.appName == "Microsoft Internet Explorer"var imgheight_closevar imgleftwindow.screen.width800 ? imgheight_close=120:imgheight_close=120window.screen.width800 ? imgleft=15:imgleft=122function myload(){myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight_close;myleft.style.left=imgleft;leftmove();}function leftmove(){myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight_close;myleft.style.left=imgleft;setTimeout("leftmove();",50)}function MM_reloadPage(init) {if (init==true) with (navigator) {if ((appName=="Netscape")(parseInt(appVersion)==4)) {document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}MM_reloadPage(true)function close_float_left(){myleft.style.visibility='hidden';}if(document.ns){document.write("div id=myleft style='position: absolute;width:80;top:300;left:5;visibility: visible;z-index: 1'styleA.closefloat:link,A.refloat:visited {text-decoration:none;color:#000000;font-size:12px}A.closefloat:active,A.refloat:hover {text-decoration:underline;color:#0000FF;font-size:12px}/styletable border=0 cellpadding=0 cellspacing=0trtd");if(ad_float_left_type!="swf")document.write("a href='" + ad_float_left_url + "' target = '_blank'img src='" + ad_float_left_src + "' WIDTH=100 HEIGHT=100 border = 0/a");elsedocument.write("EMBED src='" + ad_float_left_src + "' FlashVars='" + ad_float_left_url + "' quality=high WIDTH=80 HEIGHT=80 TYPE='application/x-shockwave-flash' id=changhongout /EMBED");document.write("/td/trtrtd width=80 height=20 align=righta href='javascript:close_float_left();void(0);' class=closefloatfont color=#0000ff size=2关闭font/a/td/tr/table/div");myload()}/script/body/html

怎么用css样式表实现网页上的广告的漂浮啊?

css只能实现广告漂浮在一个指定的地方,不能动的,如果需要移动的广告就必需用js代码实现的

css漂浮代码为:position:absolute;

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

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

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


取消回复欢迎 发表评论:

分享到

温馨提示

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

联系我们反馈

立即下载