以前做的,还能用参考一下:
<div id=g_xx style="position:absolute;top:-500px;left:0px;"><img src=aaa.jpg height=400 width=700></div><script>
top_t = -500; //当前广告条距离顶部的最小位置
top_d = 0; //当前广告条距离顶部的最大位置
start_d();
function start_d() //广告下滚控制函数 by WYC-10-10
{
top_t += 20;
document.all.g_xx.style.top = top_t;
if (top_t < top_d){
window.setTimeout("start_d()", 50);
} else {
window.setTimeout("start_u()", 5000);
}
}
function start_u() //广告上滚控制函数 by WYC-10-10
{
top_t -= 20;
document.all.g_xx.style.top = top_t;
if (top_t > -500){
window.setTimeout("start_u()", 50);
}
}
</script>