<script>
var Rimifon = {
"Ads" : new Object,
"NewFloatAd" : function(imgUrl, strLink)
{
var ad = document.createElement("a");
ad.DirV = true;
ad.DirH = true;
ad.AutoMove = true;
ad.Image = new Image;
ad.Seed = Math.random();
ad.Timer = setInterval("Rimifon.Float(" + ad.Seed + ")", 50);
this.Ads[ad.Seed] = ad;
ad.Image.Parent = ad;
ad.style.position = "absolute";
ad.style.left = 0;
ad.style.top = 0;
ad.Image.src = imgUrl;
ad.Image.onmouseover = function(){this.Parent.AutoMove = false;}
ad.Image.onmouseout = function(){this.Parent.AutoMove = true;}
if(strLink)
{
ad.href = strLink;
ad.Image.border = 0;
ad.target = "_blank";
}
ad.appendChild(ad.Image);
document.body.appendChild(ad);
return ad;
},
"Float" : function(floatId)
{
var ad = this.Ads[floatId];
if(ad.AutoMove)
{
var curLeft = parseInt(ad.style.left);
var curTop = parseInt(ad.style.top);
if(ad.offsetWidth + curLeft > document.body.clientWidth + document.body.scrollLeft - 1)
{
curLeft = document.body.scrollLeft + document.body.clientWidth - ad.offsetWidth;
ad.DirH = false;
}
if(ad.offsetHeight + curTop > document.body.clientHeight + document.body.scrollTop - 1)
{
curTop = document.body.scrollTop + document.body.clientHeight - ad.offsetHeight;
ad.DirV = false;
}
if(curLeft < document.body.scrollLeft)
{
curLeft = document.body.scrollLeft;
ad.DirH = true;
}
if(curTop < document.body.scrollTop)
{
curTop = document.body.scrollTop;
ad.DirV = true;
}
ad.style.left = curLeft + (ad.DirH ? 1 : -1) + "px";
ad.style.top = curTop + (ad.DirV ? 1 : -1) + "px";
}
}
}
</script><body><div style="width:30cm;height:40cm"></div></body><script>
Rimifon.NewFloatAd("<img src=\"m02.gif \"border=0>", "http://www.bai0du.com");
var ad = Rimifon.NewFloatAd("c:\\m16.jpg");
ad.style.left = 500;
ad.style.top = 456;
ad.Image.width = 88;
ad.Image.height = 31;
</script>
这是一个网页上浮动的广告栏但是这条指令("<img src=\"m02.gif \"border=0>", 无法找到我的图片,其实我的图片放在我做的网站的根目录里了,希望大家帮我改一改,一定要改成相对地址,因为绝对地址我会改。
我的这个程序我已经实验了,没其他问题,只能显示两个无图的框。
请那位大哥大姐帮小弟这个忙!!!!急急!!!!!!!!!!!!!!
var Rimifon = {
"Ads" : new Object,
"NewFloatAd" : function(imgUrl, strLink)
{
var ad = document.createElement("a");
ad.DirV = true;
ad.DirH = true;
ad.AutoMove = true;
ad.Image = new Image;
ad.Seed = Math.random();
ad.Timer = setInterval("Rimifon.Float(" + ad.Seed + ")", 50);
this.Ads[ad.Seed] = ad;
ad.Image.Parent = ad;
ad.style.position = "absolute";
ad.style.left = 0;
ad.style.top = 0;
ad.Image.src = imgUrl;
ad.Image.onmouseover = function(){this.Parent.AutoMove = false;}
ad.Image.onmouseout = function(){this.Parent.AutoMove = true;}
if(strLink)
{
ad.href = strLink;
ad.Image.border = 0;
ad.target = "_blank";
}
ad.appendChild(ad.Image);
document.body.appendChild(ad);
return ad;
},
"Float" : function(floatId)
{
var ad = this.Ads[floatId];
if(ad.AutoMove)
{
var curLeft = parseInt(ad.style.left);
var curTop = parseInt(ad.style.top);
if(ad.offsetWidth + curLeft > document.body.clientWidth + document.body.scrollLeft - 1)
{
curLeft = document.body.scrollLeft + document.body.clientWidth - ad.offsetWidth;
ad.DirH = false;
}
if(ad.offsetHeight + curTop > document.body.clientHeight + document.body.scrollTop - 1)
{
curTop = document.body.scrollTop + document.body.clientHeight - ad.offsetHeight;
ad.DirV = false;
}
if(curLeft < document.body.scrollLeft)
{
curLeft = document.body.scrollLeft;
ad.DirH = true;
}
if(curTop < document.body.scrollTop)
{
curTop = document.body.scrollTop;
ad.DirV = true;
}
ad.style.left = curLeft + (ad.DirH ? 1 : -1) + "px";
ad.style.top = curTop + (ad.DirV ? 1 : -1) + "px";
}
}
}
</script><body><div style="width:30cm;height:40cm"></div></body><script>
Rimifon.NewFloatAd("<img src=\"m02.gif \"border=0>", "http://www.bai0du.com");
var ad = Rimifon.NewFloatAd("c:\\m16.jpg");
ad.style.left = 500;
ad.style.top = 456;
ad.Image.width = 88;
ad.Image.height = 31;
</script>
这是一个网页上浮动的广告栏但是这条指令("<img src=\"m02.gif \"border=0>", 无法找到我的图片,其实我的图片放在我做的网站的根目录里了,希望大家帮我改一改,一定要改成相对地址,因为绝对地址我会改。
我的这个程序我已经实验了,没其他问题,只能显示两个无图的框。
请那位大哥大姐帮小弟这个忙!!!!急急!!!!!!!!!!!!!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货