当前位置:开发者网络 >> 网页特效 >> 文本特效 >> 内容
精彩推荐
分类最新特效
分类热点特效
  
在一段文字上有一个不停移动的小圆点,就象个导读器,酷
日期:2005-06-21   人气:   【字体: 】【收藏此文


<!-- 网页特效代码由[中国WEB开发者网络:http://www.ChinaWebDev.com]提供! -->
<!-- 要实现此效果需要 2 个步骤: -->

<!-- 第 1 步: -->
<!-- 把<BODY>中的属性代码改为: -->

<BODY onselectstart="return false">



<!-- 第 2 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->

<script>
var curRects,moveStep,curLine,ballLen,moveTime


function startMove()
{
curRects = document.body.createTextRange().getClientRects()

var TempRect = ball.getBoundingClientRect()

ballLen = TempRect.right - TempRect.left

curLine = 0
moveStep = 0

clearTimeout(moveTime)

moveBall()
}

window.onload = startMove
window.onresize = startMove

var isStop = false

function document.onclick()
{
if(document.readyState == "complete")
{
isStop = !isStop

if(isStop)
clearTimeout(moveTime)
else
moveTime = setTimeout("moveBallInLine()",50)
}
}

function moveBall()
{
if(curLine == curRects.length)
curLine = 0

moveStep = 0


with(ball.style)
{
top = curRects[curLine].top
left = curRects[curLine].left
}


moveTime = setTimeout("moveBallInLine()",50)
}

function moveBallInLine()
{
moveStep += 5

if(moveStep < curRects[curLine].right - curRects[curLine].left - ballLen)
{
ball.style.left = moveStep + curRects[curLine].left

moveTime = setTimeout("moveBallInLine()",50)
}
else
{
ball.style.left = curRects[curLine].right - curRects[curLine].left - ballLen

curLine ++

moveBall()
}
}
</script>
<p>中新网北京8月26日消息:美国常务副国务卿阿米蒂奇抵达北京,准备与中方人员讨论中美领袖10月举行高峰会议等事宜。</p>
<p>外电报道说,阿米蒂奇星期一预计会和中国官员讨论一系列双边和国际课题,其中包括为中国国家主席江泽民在10月访问美国作好准备工作。
</p>
<p>8月8日,中国外交部发言人孔泉就美国常务副国务卿阿米蒂奇访华事回答记者提问时说,经中美双方商定,美国常务副国务卿里查德·阿米蒂奇将于8月25日至27日访问中国,与李肇星副外长举行政治磋商。届时双方将就中美关系和共同关心的重大国际及地区问题交换看法。</p>
<div id="ball" style="position: absolute; top: 162; left: 12; width: 6; height: 16">

</div>