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

推荐订阅源

The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
N
Netflix TechBlog - Medium
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
宝玉的分享
宝玉的分享
Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
量子位
Blog — PlanetScale
Blog — PlanetScale
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
阮一峰的网络日志
阮一峰的网络日志
D
Docker
罗磊的独立博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
IT之家
IT之家
MyScale Blog
MyScale Blog
Microsoft Azure Blog
Microsoft Azure Blog

博客园 - joinsky

asp.net下载代码 - joinsky - 博客园 必须会的十种语言 df 有关程序员的传说 网站标准 asp.net中的DES加密 ASp.net中的定位问题. - joinsky - 博客园 文字的竖排与横排 - joinsky - 博客园 两个常用的存储过程(转) iframe自适应网页内容的高度 - joinsky - 博客园 IErrorInfo.GetDescription 因 E_FAIL(0x80004005) 而失败 javascript中object转换为string 数据库中游标的使用.....用于循环 网页技巧之如何隐藏状态栏里出现的LINK信息 页面过长自动进行分页(转) 自定义组件的执行周期(转) 调用DLL中的方法(转) vs2003问题集锦 HTTP/1.1 500 Internal Server Error 解决方法
随页面滚动的层(转)
joinsky · 2006-06-13 · via 博客园 - joinsky

drop.js文件的内容
self.onError=null;   
currentX = currentY = 0;   
whichIt = null;   
lastScrollX = 0; //最后离左边距离的负值
lastScrollY =0;  //最后离顶部的高度的负值
 
//----------------------start fun秒执行一次  
function heartBeat(id1,id2) {   
diffY = document.body.scrollTop;
diffX = document.body.scrollLeft;

if(diffY != lastScrollY) {   
percent = .1 * (diffY - lastScrollY);   
if(percent > 0) percent = Math.ceil(percent);   
else percent = Math.floor(percent);   
id1.style.pixelTop += percent;
id2.style.pixelTop += percent;  
lastScrollY = lastScrollY + percent;   
}   

if(diffX != lastScrollX) {   
percent = .1 * (diffX - lastScrollX);   
if(percent > 0) percent = Math.ceil(percent);   
else percent = Math.floor(percent);   
id1.style.pixelTop += percent;
id2.style.pixelTop += percent;     
lastScrollX = lastScrollX + percent;   
}   
}   
//-----------------------end fun
scr=screen.width
left_1=(scr>800)?10:145
right_1=(scr>800)?880:580

//左侧图片
document.write("<DIV id=f1 style='left: "+left_1+"px; top: 460px; POSITION: absolute;'><a href='#' target=_blank><img src='041.gif' border=0 width=120 height=125></a></div>")

//右侧图片
document.write("<DIV id=f2 style='left: "+right_1+"px; top: 215px; POSITION: absolute;'><a href='#' target=_blank><img src='011.gif' border=0 width=150 height=47></a></div>")

action = window.setInterval("heartBeat(f1,f2)",1);  

1.html代码:
<html>
<head>
<script src="drop.js" language="javascript">
</script>
</head>
<body>
<table>
 <tr>
  <td height=10278px>
  </td>
 </tr>

</table>
asdf
</body>
</html>