window.onload?=?function(){
moveMessage();
}
function?moveMessage(){
?var?news?=?document.getElementById("message");
?news.style.position?=?"absolute";
?var?xpos?=?parseInt(news.style.left);
?var?ypos?=?parseInt(news.style.top);
?if(xpos?==?500&&ypos?==?500){
??return?true;
?}
?if(xpos<500){
??xpos?++;
?}
?if(xpos>500){
??xpos?--;
?}
?if(ypos<500){
??ypos?++?;
?}
?if(ypos>500){
??ypos?--;
?}
?news.style.left?=?xpos?+?"px";
?news.style.top?=?ypos?+?"px";
?setTimeout("moveMessage()",1000);
}?想實(shí)現(xiàn)id為message的文本按時(shí)間在頁(yè)面移動(dòng),可是調(diào)用該函數(shù)卻沒(méi)有效果。。。檢查了半天也沒(méi)發(fā)現(xiàn)什么錯(cuò)誤啊,所以發(fā)上來(lái)請(qǐng)大家看看。
函數(shù)沒(méi)有效果,檢查了好幾遍。。。也沒(méi)發(fā)現(xiàn)問(wèn)題啊 求幫忙。
慕數(shù)據(jù)4485210
2016-02-28 10:21:23