随机调用iframe JS 的广告代码,随页面滚动广告循环播放。。
2006-02-26 00:50
801 查看
var imgheight
var imgleft
document.ns = navigator.appName == "Netscape"
window.screen.width>800 ? imgheight=202:imgheight=202
window.screen.width>800 ? imgleft=15:imgleft=15
function myload()
{
if (navigator.appName == "Netscape")
{document.myleft.pageY=pageYOffset+window.innerHeight-imgheight;
document.myleft.pageX=imgleft;
leftmove();
}
else
{
myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
myleft.style.left=imgleft;
leftmove();
}
}
function leftmove()
{
if(document.ns)
{
document.myleft.top=pageYOffset+window.innerHeight-imgheight
document.myleft.left=imgleft;
setTimeout("leftmove();",80)
}
else
{
myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
myleft.style.left=imgleft;
setTimeout("leftmove();",80)
}
}
function MM_reloadPage(init) { //reloads the window if Nav4 resized
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)
if (navigator.appName == "Netscape")
{
document.write("<layer id=myleft style='position:absolute; width:40px; height:20px; z-index:2; left: 10; top: 0;'><iframe name=click src=http://code.51ads.com/createads_click.aspx?userid=1500&typeid=18&logo=true&sn=325ad67f01a5c93112f7e028504f4411 width=90 height=90 marginwidth=0 scrolling=no border=0 frameborder=0></iframe></layer>");
myload()}
else
{
document.write("<div id=myleft style='position: absolute;width:80;top:50;left:5;visibility: visible;z-index: 1'><iframe name=click src=http://code.51ads.com/createads_click.aspx?userid=1500&typeid=18&logo=true&sn=325ad67f01a5c93112f7e028504f4411 width=90 height=90 marginwidth=0 scrolling=no border=0 frameborder=0></iframe></div>");
myload()
}
这个是页面滚动漂浮广告80X80的代码,
用你的iframe换上去就可以了。。最好保存成JS ,再调用。。
有问题可回复。
var imgleft
document.ns = navigator.appName == "Netscape"
window.screen.width>800 ? imgheight=202:imgheight=202
window.screen.width>800 ? imgleft=15:imgleft=15
function myload()
{
if (navigator.appName == "Netscape")
{document.myleft.pageY=pageYOffset+window.innerHeight-imgheight;
document.myleft.pageX=imgleft;
leftmove();
}
else
{
myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
myleft.style.left=imgleft;
leftmove();
}
}
function leftmove()
{
if(document.ns)
{
document.myleft.top=pageYOffset+window.innerHeight-imgheight
document.myleft.left=imgleft;
setTimeout("leftmove();",80)
}
else
{
myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
myleft.style.left=imgleft;
setTimeout("leftmove();",80)
}
}
function MM_reloadPage(init) { //reloads the window if Nav4 resized
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)
if (navigator.appName == "Netscape")
{
document.write("<layer id=myleft style='position:absolute; width:40px; height:20px; z-index:2; left: 10; top: 0;'><iframe name=click src=http://code.51ads.com/createads_click.aspx?userid=1500&typeid=18&logo=true&sn=325ad67f01a5c93112f7e028504f4411 width=90 height=90 marginwidth=0 scrolling=no border=0 frameborder=0></iframe></layer>");
myload()}
else
{
document.write("<div id=myleft style='position: absolute;width:80;top:50;left:5;visibility: visible;z-index: 1'><iframe name=click src=http://code.51ads.com/createads_click.aspx?userid=1500&typeid=18&logo=true&sn=325ad67f01a5c93112f7e028504f4411 width=90 height=90 marginwidth=0 scrolling=no border=0 frameborder=0></iframe></div>");
myload()
}
这个是页面滚动漂浮广告80X80的代码,
用你的iframe换上去就可以了。。最好保存成JS ,再调用。。
有问题可回复。
相关文章推荐
- 非常平滑的JS图片滚动特效代码,无缝循环,速度可自定义,鼠标悬停时停止。它的特点是JS和图片地址分离,这样做你就经易的从数据库动态调用每张图片的地址,方便控制,因此它非常的应用。
- JS随机漂浮广告代码具体实例
- 根据IP显示天气预报代码:只显示成一行,可在页面调用JS即可
- js网页侧边随页面滚动广告效果实现
- iframe里面的页面调用父窗口,左右窗口js函数的方法
- javascript中iframe里面的页面调用父窗口js函数的方法
- js左右弹性滚动对联广告代码分享
- iframe子父页面调用js函数示例
- C#调用JS实现滚动截屏-页面和页面元素通用
- js离开当前页面代码,调用方法
- JS技巧:调用iframe中父页面/子页面中的JavaScript方法
- JS iframe父子页面元素调用方法 window parent top 解释
- JS+FLASH幻灯片播放图片脚本,整理了代码,使得调用更加方便!
- JS幻灯片可循环播放可平滑旋转带滚动导航(自写)
- 在页面里JS代码里onclick去调用后台文件中的一个方法
- js防止页面被iframe调用的方法
- 父页面调用iframe里的js函数相关例程,Iframe之间通讯研究
- 用WebBrowser承载视图,html编写页面,c#编写后端代码;用js调用后端代码,传入function参数作为回调;
- 同一页面可次调用的jquery文字无缝滚动插件代码