Sai


disconnected
主题工具

上下移动的广告代码

... 发表于 2006-7-13 13:47  ... 10128 次点击

动来动去怪不舒服的,做个备份
<script language='JavaScript'>
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);

function getRef(id) {
if (isDOM) return document.getElementById(id);
if (isIE4) return document.all[id];
if (isNS4) return document.layers[id];
}

var isNS = navigator.appName == 'Netscape';

function moveRightEdge() {
var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;

if (isNS4) {
yMenuFrom = Scroll.top;
yMenuTo = windows.pageYOffset + 260;
} else if (isDOM) {
yMenuFrom = parseInt (Scroll.style.top, 10);
yMenuTo = (isNS ? window.pageYOffset : document.body.scrollTop) + 77;
}
timeoutNextCheck = 100;

if (yMenuFrom != yMenuTo) {
yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20);
if (yMenuTo < yMenuFrom)
yOffset = -yOffset;
if (isNS4)
Scroll.top += yOffset;
else if (isDOM)
Scroll.style.top = parseInt (Scroll.style.top, 10) + yOffset;
timeoutNextCheck = 1;
}
setTimeout ('moveRightEdge()', timeoutNextCheck);
}
</SCRIPT>
<DIV id="Scrollmemu" style="width:67px; position:absolute; z-index:3; left:860px;">
<a href="http://saicn.com/nnm24" target="_blank"><img src="http://saicn.com/bbs/new/nnm24.jpg"></a>
  <SCRIPT language=javascript>
if (isNS4) {
var Scroll = document['Scrollmemu'];
Scroll.top = top.pageYOffset + 300;
Scroll.visibility = 'visible';
moveRightEdge();
} else if (isDOM) {
var Scroll = getRef('Scrollmemu');
Scroll.style.top = (isNS ? window.pageYOffset : document.body.scrollTop) + 300;
Scroll.style.visibility = 'visible';
moveRightEdge();
}
</SCRIPT>
</div>

</div>


本主题共有 1 条回复 | 回到顶部
#1 - 2006-7-13 16:52
xlfdll 地球
还不错……JavaScript
基本上读懂了……
看完之后有话想说?那就帮楼主加盖一层吧!

在回复之前你需要先进行登录
用户名 / UID
密码
Project Parasynthesis | Based on Discuz! 5.5.0 | Thanks to Livid
About | Help | Developer | N2Design
清除 Cookies - 联系我们 - 无名杂志 - Archiver - Mobile
Processed in 0.036603 second(s), 6 queries, Gzip enabled