网站常用广告代码,网站常用广告代码大全
求网站两侧浮动广告代码
suspendcode="DIV id=lovexin1 style='Z-INDEX: 10; LEFT: 6px; POSITION: absolute; TOP: 105px; width: 100; height: 300px;'img src='images/close.gif' onClick='javascript:window.hide()' width='100' height='14' border='0' vspace='3' alt='关闭对联广告'EMBED src='images/4rr.swf' quality=high WIDTH=100 HEIGHT=300 TYPE='application/x-shockwave-flash' id=ad wmode=opaque/EMBED/DIV"
document.write(suspendcode);
suspendcode="DIV id=lovexin2 style='Z-INDEX: 10; LEFT: 896px; POSITION: absolute; TOP: 105px; width: 100; height: 300px;'img src='images/close.gif' onClick='javascript:window.hide()' width='100' height='14' border='0' vspace='3' alt='关闭对联广告'EMBED src='images/4rr.swf' quality=high WIDTH=100 HEIGHT=300 TYPE='application/x-shockwave-flash' id=ad wmode=opaque/EMBED/DIV"
document.write(suspendcode);
//flash格式调用方法
//EMBED src='flash.swf' quality=high WIDTH=100 HEIGHT=300 TYPE='application/x-shockwave-flash' id=ad wmode=opaque/EMBED
lastScrollY=0;
function heartBeat(){
diffY=document.body.scrollTop;
percent=.3*(diffY-lastScrollY);
if(percent0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.all.lovexin1.style.pixelTop+=percent;
document.all.lovexin2.style.pixelTop+=percent;
lastScrollY=lastScrollY+percent;
}
function hide()
{
lovexin1.style.visibility="hidden";
lovexin2.style.visibility="hidden";
}
window.setInterval("heartBeat()",1);
如何在网页中插入广告代码。
1.创建一个名为“topwindow.html”的web文件。
2. 浮动窗口的对应代码如下: HTML
大小:30;填充-顶部:20px;文本-对齐:左;内边距-左:70像素;线条-高度:40px;背景:url(110.jpg)topcenterno-repeat;宽度:252px;
身高:127px;line-heiht:10px;文本-对齐:居中;字体系列:“微软优雅黑色,宋体,正体,黑色”。
3.颜色:#fafafa;文本的影子:rgba(255255255,0.5)05px6pxrgba(255255255,0.2)1px3px3px;}
4.然后将图中所示的代码添加到主页和之间,标记的SRC属性“FDCK”指向的页面地址浮动窗口。
5.所有上面的代码(包括JS脚本)之间应放置,如下图所示。
6.最后,检查浮动窗口的影响,你会注意到周围的浮动窗口不断移动web页面。当鼠标悬停在它,它停止移动,点击“隐藏”按钮,自动隐藏了浮动窗口。
网站漂浮广告代码怎么写
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