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

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
V
V2EX
博客园 - 【当耐特】
WordPress大学
WordPress大学
爱范儿
爱范儿
美团技术团队
宝玉的分享
宝玉的分享
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
小众软件
小众软件
量子位
Hugging Face - Blog
Hugging Face - Blog
B
Blog RSS Feed
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 聂微东
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
博客园 - 叶小钗
GbyAI
GbyAI
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
F
Full Disclosure
G
Google Developers Blog
D
Docker
T
Tailwind CSS Blog
C
Check Point Blog
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
B
Blog
博客园 - 三生石上(FineUI控件)
博客园 - Franky
H
Help Net Security
MyScale Blog
MyScale Blog
U
Unit 42
D
DataBreaches.Net
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog
L
LangChain Blog
有赞技术团队
有赞技术团队
Martin Fowler
Martin Fowler
Microsoft Security Blog
Microsoft Security Blog

博客园 - kingboy

miniSipServer简单而不简单,轻松落地,实现电脑对固话、手机通讯 sql 去重 C# 获取客户端信息 /asp.net/WebService/WebForm C#防止WebBrowser在新窗口中打开链接页面 常用sql语句 sql 复制表 获得 DataSet中的记录总数 MySQL安装的图解 sql 按日期查询 C#中的日期函数使用大全 火车座位分布图 javascript页面跳转常用代码 GridView 自定义分页 GridView加ObjectDataSource做删除事件(ObjectDataSourceStatusEventHandler 委托) GridView日期格式模版列使用方法 (转) 非常酷的三级下拉菜单!!(javascript) JavaScript 强行弹出窗口 与 无提示关闭页面 sql事务处理(转) o(∩_∩)o...哈哈 在博客园安家了!!
首页头部下拉广告设计(javascript)
kingboy · 2008-01-17 · via 博客园 - kingboy

加在Head中

<script type="text/javascript" language="javascript">
var intervalId = null;
function slideAd(id,nStayTime,sState,nMaxHth,nMinHth){
this.stayTime=nStayTime*1000 || 3000;
this.maxHeigth=nMaxHth || 330//广告最大高度
this.minHeigth=nMinHth || 1;
this.state=sState || "down" ;
var obj = document.getElementById(id);
if(intervalId != null)window.clearInterval(intervalId);
function openBox(){
 
var h = obj.offsetHeight;
 obj.style.height 
= ((this.state == "down"? (h +5 ) : (h - 5))+"px";
 
if(obj.offsetHeight>this.maxHeigth){
 window.clearInterval(intervalId);
 intervalId
=window.setInterval(closeBox,this.stayTime);
 }

 
if (obj.offsetHeight<this.minHeigth){
 window.clearInterval(intervalId);
 obj.style.display
="none";
 }

}

function closeBox(){
 slideAd(id,
this.stayTime,"up",nMaxHth,nMinHth);
}

intervalId 
= window.setInterval(openBox,2);
}

</script>

加在Body下面

<div id="slideAD" style="overflow: hidden; height: 0; padding-left:10px; width:985px"><div id="hd"><img src="/img/close.gif" alt="关闭" onclick="slideAd('slideAD',5,'up');return false;"/></div>
<div align="center">这里插入相应的图片或flash</script></div>
</div>

设置当页面完全加载之后执行,10MS 检测一次

<script type="text/javascript">

  
<!--   
  
function   chk(){   
  (
this.document.readyState=="complete")?slideAd('slideAD',8):setTimeout('chk()',10);   
  }
   
  chk();   
  
//-->   


</script>