本页主题: 在自己的网站做圣诞节日的漂浮代码 打印 | 加为IE收藏 | 复制链接 | 收藏主题 | 上一主题 | 下一主题

雪会哭的
宣传大使奖
级别: 论坛版主

 在自己的网站做圣诞节日的漂浮代码

Copy code
<div id="img" style="position:absolute;">
<a href="[url]http://aqjazz.blog.bitscn.com/archives/2006/10299.html[/url]" target="_blank">
<img src="http://blog.bitscn.com/UploadFiles/2006-12/1219591071.gif" border="0"></a>
</div>

<SCRIPT LANGUAGE="JavaScript">
<!--
var xPos = 20;
var yPos = document.body.clientHeight;
var step = 1;
var delay = 30;
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
img.style.top = yPos;
function changePos() {
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
img.style.left = xPos + document.body.scrollLeft;
img.style.top = yPos + document.body.scrollTop;
if (yon) {
yPos = yPos + step;
}
else {
yPos = yPos - step;
}
if (yPos < 0) {
yon = 1;
yPos = 0;
}
if (yPos >= (height - Hoffset)) {
yon = 0;
yPos = (height - Hoffset);
}
if (xon) {
xPos = xPos + step;
}
else {
xPos = xPos - step;
}
if (xPos < 0) {
xon = 1;
xPos = 0;
}
if (xPos >= (width - Woffset)) {
xon = 0;
xPos = (width - Woffset);
}
}
function www_helpor_net() {
img.visibility = "visible";
interval = setInterval('changePos()', delay);
}
www_helpor_net();
//For more,visit:aqjazz.blog.bitscn.com
-->
</script>
顶端 Posted: 2007-01-31 13:17 | [楼 主]
帖子浏览记录 版块浏览记录
☆→华夏黑盟社区 » 站长之家

Time now is:11-23 18:29, Gzip enabled 浙ICP备06052510号
Powered by PHPWind & Uu1001 v2.0 Certificate Code © 2003-08 PHPWind.com Corporation