设为首页
加入收藏
发送稿件
[推荐]双侧浮动广告的制作

将以下代码保存为 leftad.js 文件

// float_l_img.js

 

// change var

 

var adSrc2 = "llf21.gif"

var adUrl2 = "http://luos.org/"

var adWidth2 = "80"

var adHeight2 = "80"

 

// change var

 

var weny2 = 3   //初始底边距

var wenx2 = 20  //初始左边距

 

document.ns = navigator.appName == "Netscape"

 

function load2()

{

if (navigator.appName == "Netscape") {

       document.netease2.pageY=pageYOffset+window.innerHeight-adHeight2-weny2;

       document.netease2.pageX=wenx2;

       move2();}

else {

       netease2.style.top=document.body.scrollTop+document.body.offsetHeight-adHeight2-weny2-20;//调整垂直位置

       netease2.style.left=wenx2;

       move2();}

}

 

function move2() {

       if(document.ns) {

              document.netease2.top=pageYOffset+window.innerHeight-adHeight2-weny2;

              document.netease2.left=wenx2;

              setTimeout("move2();",80)}

       else {

              netease2.style.top=document.body.scrollTop+document.body.offsetHeight-adHeight2-weny2-20;//调整垂直位置

              netease2.style.left=wenx2;

              setTimeout("move2();",80)}

}

 

function MM_reloadPage2(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_reloadPage2;

                     }

              }

       else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)

              location.reload();

}

 

MM_reloadPage2(true)

if (navigator.appName == "Netscape") {

   //document.write("<layer id=netease2 top=250 width=" + adWidth2 + " height=" + adHeight2 + " ><a href=" + adUrl2 + " target=_blank><img src=" + adSrc2 + " border=0 width=" + adWidth2 + " height=" + adHeight2 + "></a></layer>");

  document.write("<layer id=netease2 top=300 width=" + adWidth2 + " height=" + adHeight2 + " ><embed src=" + adSrc2 + " border=0 width=" + adWidth2 + " height=" + adHeight2 + "></embed></layer>");

       load2();

       }

else  {

       document.write("<div id=netease2 style='top:200; position: absolute; width:" + adWidth2 + ";'><a href=" + adUrl2 + " target=_blank><img src=" + adSrc2 + " border=0 width=" + adWidth2 + " height=" + adHeight2 + "></a></div>");

   //document.write("<//div id=netease2 style='top:300; position: absolute; width:" + adWidth2 + ";'><//embed src=" + adSrc2 + " border=0 width=" + adWidth2 + " height=" + adHeight2 + "></embed></div>");

       load2();

       }

 

将以下代码保存为 rightad.js 文件

// float_r_img.js

 

// change var

var adSrc4 = "llf21.gif"

var adUrl4 = "http://www.g632.1a.cn"

var adWidth4 = "80"

var adHeight4 = "80"

// change var

var weny4 = 3   //初始底边距

var wenx4 = 20  //初始右边距

document.ns = navigator.appName == "Netscape"

 

function load4()

{

if (navigator.appName == "Netscape") {

       document.netease4.pageY=pageYOffset+window.innerHeight-adHeight4-weny4;

       document.netease4.pageX=+window.innerWidth-adWidth4-wenx4;

       move4();

       }

else {

       netease4.style.top=document.body.scrollTop+document.body.offsetHeight-adHeight4-weny4-20;//调整垂直位置

       netease4.style.left=document.body.offsetWidth-adWidth4-wenx4-20;//调整水平位置

       move4();

       }

}

 

function move4() {

       if(document.ns) {

              document.netease4.top=pageYOffset+window.innerHeight-adHeight4-weny4;

              document.netease4.left=+window.innerWidth-adWidth4-wenx4;

              setTimeout("move4();",80)

       }

       else {

              netease4.style.top=document.body.scrollTop+document.body.offsetHeight-adHeight4-weny4-20;//调整垂直位置

              netease4.style.left=document.body.offsetWidth-adWidth4-wenx4-20;//调整水平位置

              setTimeout("move4();",80)

       }

}

 

function MM_reloadPage4(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_reloadPage4;

                     }

              }

       else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)

              location.reload();

}

MM_reloadPage4(true)

if (navigator.appName == "Netscape") {

       document.write("<layer id=netease4 top=300 width=" + adWidth4 + " height=" + adHeight4 + " ><a href=" + adUrl4 + " target=_blank><img src=" + adSrc4 + " border=0 width=" + adWidth4 + " height=" + adHeight4 + "></a></layer>");

       //document.write("<layer id=netease4 top=250 width=" + adWidth4 + " height=" + adHeight4 + " ><embed src=" + adSrc4 + " border=0 width=" + adWidth4 + " height=" + adHeight4 + "></embed><layer>");

       load4();

       }

else  {

       document.write("<div id=netease4 style='top:300; position: absolute; width:" + adWidth4 + ";'><a href=" + adUrl4 + " target=_blank><img src=" + adSrc4 + " border=0 width=" + adWidth4 + " height=" + adHeight4 + "></a></div>");

       //document.write("<div id=netease4 style='top:250; position: absolute; width:" + adWidth4 + ";'><embed src=" + adSrc4 + " border=0 width=" + adWidth4 + " height=" + adHeight4 + "></embed></div>");

       load4();

 

       }

 

在页面中用以下两句调用

 

<script language="javascript" src="leftad.js">

</script>

 <script language="javascript" src="rightad.js">

</script>



oooooooooo家园提示:人自为谱,家自为说,正误自辨,取舍自酌。引用注明作者和出处。 来源:罗氏家园
阅读:4085
日期:2005/1/2

查看评论 】 【 收藏 】 【 打印 】 【 关闭 】 【字体: 】 
上一篇:隐藏在WinXP中的秘密武器
下一篇:跟随打开页面移动的小球
  >> 相关文章
 
发表评论


        站长提示:这里不是互动留言处!
点  评: 字数0
用户名:  密码:

  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款
家园地址:http://www.luos.org  粤ICP备13039246号-2
家园创建:罗良富   技术支持:AssumeYessure   法律顾问:罗劲松