对联广告不浮动?

来源:百度知道 编辑:UC知道 时间:2024/05/21 07:27:07
<!--
function closeAd(){
huashuolayer2.style.visibility='hidden';
huashuolayer3.style.visibility='hidden';}
function winload()
{
huashuolayer2.style.top=50;
huashuolayer2.style.left=5;
huashuolayer3.style.top=50;
huashuolayer3.style.right=5;
}
if(document.body.offsetWidth>800){
{
document.write('<div id=huashuolayer2 style="position: absolute;visibility:visible;z-index:1"><table width=100 border=0 cellspacing=0 cellpadding=0><tr><td height=10 align=right bgcolor=ffffff><a href=javascript:closeAd()>关闭</a></td></tr><tr><td><a href="http://localhost:80/openad.asp?adid=1" target=_blank><img src="http://www.lvliang8.cn/adpic/ban

现在很多网站广告做的如火如荼,现在我就来介绍一下常见的对联浮动广告效果的代码使用方法,本文介绍的这种效果,在1024*768分辨率下正常显示,在800*600的分辨率下可以自动隐藏,以免遮住页面影响访问者浏览内容,而且与前面两个代码不同的是,广告图下方增加了一个图片按纽,允许访客点击关闭广告图片,下面文本框中就是实现效果所需代码:

var delta=0.015;
var collection;
var closeB=false;
function floaters() {
this.items = [];
this.addItem = function(id,x,y,content)
{
document.write('<DIV id='+id+' style="Z-INDEX: 10; POSITION: absolute; width:80px; height:60px;left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+'">'+content+'</DIV>');

var newItem = {};
newItem.object = document.getElementById(id);
newItem.x = x;
newItem.y = y;
this.items[this.items.length] = newItem;
}
this.play = function()
{
collection = this.items
setInterval('play()',30);
}
}
function play()
{
if(screen.width<=800 || clo