惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
C
Check Point Blog
D
Docker
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
量子位
有赞技术团队
有赞技术团队
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
M
MIT News - Artificial intelligence
B
Blog
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
月光博客
月光博客

博客园 - Burt

软件项目研发的设计流程 访问IIS元数据库失败解决方法(转) 经典SQL语句大全 js 比较2日期大小 - Burt - 博客园 合并表格,并实现对datatable的group by 功能 - Burt 时间段查询 left join on sql 日期格式转换(convert用法)(转) 分页存储过程 刷新后保持页面滚动条位置C#&VB(转) - Burt - 博客园 Dropdownlist样式设置 - Burt - 博客园 TreeView的遍历(转) 读取天气预报所产生乱码解决方法MiniSite.Weather.print("Wealth") 40种网页常用小技巧(javascript) 页面图象鼠标操作放大和制作图片热点 无法将类型login_aspx转换为System.Web.UI.WebControl c# 发邮件(转摘) [没有相关源的行] 访问被拒绝 水晶报表制作
页面自动刷新以及广告程序得Javascript代码
Burt · 2007-10-25 · via 博客园 - Burt

自动杀新: 

   <%--//定时刷新--%>
<script>
      var limit="0:10"
      if (document.images){
   
      var parselimit=limit.split(":")
   
      parselimit=parselimit[0]*60+parselimit[1]*1
   
      }
   
      function beginrefresh(){
   
      if (!document.images)
   
      return
   
      if (parselimit==1)
   
      window.location.reload()
   
      else{
   
      parselimit-=1
   
      curmin=Math.floor(parselimit/60)
   
      cursec=parselimit%60
   
      if (curmin!=0)
   
      curtime=curmin+"分"+cursec+"秒后重刷本页!"
   
      else
   
      curtime=cursec+"秒后重刷本页!"
   
      window.status=curtime
   
      setTimeout("beginrefresh()",1000)
   
      }
   
      }
      window.onload=beginrefresh

   
      </script>

广告程序 :

 <%--//浮动广告程序 --%>
      <SCRIPT for=window event=onload language="JScript">
      initAd();//载入页面后,调用函数initAd()
      </SCRIPT>
      <script language="JScript">
      <!--
      function initAd() {
      document.all.AdLayer.style.posTop = -200;//设置onLoad事件激发以后,广告层相对于固定后的y方向位置
      document.all.AdLayer.style.visibility = 'visible'//设置层为可见
      MoveLayer('AdLayer');//调用函数MoveLayer()
      }
      function MoveLayer(layerName) {
      var x = 3;//浮动广告层固定于浏览器的x方向位置
      var y = 30;//浮动广告层固定于浏览器的y方向位置
      var diff = (document.body.scrollTop + y - document.all.AdLayer.style.posTop)*.40;
      var y = document.body.scrollTop + y - diff;
      eval("document.all." + layerName + ".style.posTop = y");
      eval("document.all." + layerName + ".style.posLeft = x");//移动广告层
      setTimeout("MoveLayer('AdLayer');", 20);//设置20毫秒后再调用函数MoveLayer()
      }
      //-->
      </script>

添加一个显示广告得层:

  <div id=AdLayer style='position:absolute; width:61px; height:59px; z-index:20; visibility:hidden;; left: 3px; top: 30px'>
      <a href="http://blog.xiaocui.cn"><img src='logo.gif' border="0" height="60" width="60"></a>
      </div>