<script language="javascript" type="text/javascript">
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.style.zIndex=99999;
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>
<div style="z-Index:999999;"></div>
<script language="javascript" type="text/javascript">
Rimifon.NewFloatAd("/pic/index/images/sypf.gif", "http://www.gtja.com/index/10year/game.html");
</script>
分享到:
相关推荐
兼容ie、firefox的漂浮广告代码! 值得下载看看!资源免费,大家分享!! 更多免费资源 http://ynsky.download.csdn.net/
NULL 博文链接:https://913.iteye.com/blog/1226887
漂浮广告,兼容ie、firefox,多个漂浮不冲突,调用只需两行代码.rar
最近做个网站,发现自己写得浮动广告不能兼容火狐和IE,在网上找了半天,才发现这么一个好用的!!所以拿来分享一下,希望可以给大家带来点方便~~
兼容性,很好,在网上找到了,拿来和大家分享一下!!
QQ在线客服浮动代码兼容IE6,7,8、Firefox、Opera、Chrome
网页中的模式对话框效果,兼容ie6,7,8 firefox等主流浏览器
OO客服右侧在线代码兼容IE 火狐,非常漂亮。跟随滚动条滚动,可以自动折叠,鼠标方式面展开。。
纯DIVCSS对联漂浮广告代码(无JS),源码网两侧漂浮。经测试,兼容IE6,IE7,Firefox浏览器。
用css实现div固定在屏幕底部,不随垂直滚动条接动而闪动,很好的实现在ie下的浮动效果,IE6 position:fixed
纯JS两侧浮动对联广告及判断客户端分辩率, 可自定义两侧浮动对联广告位置、判断...本js广告代码兼容浏览器IE6、IE7、IE8、IE9、firefox、chrome、opera、safari, js文件夹中的ad.js文件,自己修改参数及文件路径即可。
Firefox是支持background:fixed;定位的,IE6只能说是半支持,好吧,这么说吧,可能不太严谨,就是背景图片固定的效果似乎只在根结点起作用。举个很简单的例子: 先看这段css代码: body{background:url(../image/404...
两侧漂浮。经测试,兼容IE6,IE7,Firefox浏览器
兼容各种浏览器的QQ漂浮效果,火狐,IE,谷歌等等
7. firefox与IE的父元素(parentElement)的区别 3 8. document.formName.item(”itemName”) 问题 3 9. 集合类对象问题 3 10. 自定义属性问题 3 11. input.type属性问题 3 12. event.srcElement问题 3 13. body...
可兼容各种浏览器的可关闭的浮动层。已经在火狐,谷歌,和IE8下进行了测试。欢迎大家使用和评论!
网页浮动飘窗,兼容当前所有浏览器(ie7/8/9/10、firefox等),带关闭按钮。
兼容ie6 ie7 火狐等各种浏览器浮动代码,可自由修改在线联系qq