第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

javascript中return true的作用?

javascript中return true的作用?

夜盡天明ht 2016-05-21 10:15:04
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無標(biāo)題文檔</title></head><script>function addLoadEvent(func){ var oldonload=window.onload; if (typeof window.onload !='function'){ window.onload=func; } else{ window.onload=function(){ oldonload(); func(); } } }function positionMessage(){ if(!document.getElementById) return false; if(!document.getElementById) return false; var elem=document.getElementById("message"); elem.style.position="absolute"; elem.style.left="50px"; elem.style.top="100px"; }function moveMessage(){ if(!document.getElementById) return false; if(!document.getElementById("message"))return false; var elem=document.getElementById("message"); var xpos=parseInt(elem.style.left); var ypos=parseInt(elem.style.top); if(xpos==200&&ypos==100){ return true; } if(xpos<200){ xpos++; } if(xpos>200){ xpos--; } if(ypos<100){ ypos++; } if(ypos>100){ ypos--; } elem.style.left=xpos+"px"; elem.style.top=ypos+"px"; movement=setTimeout("moveMessage()",10); }addLoadEvent(positionMessage);addLoadEvent(moveMessage);</script><body><p id="message">whee</p></body></html>這個里面用return?true;是不是實現(xiàn)了一個循環(huán),這個地方?if(xpos<200){ xpos++; } if(xpos>200){ xpos--; } if(ypos<100){ ypos++; } if(ypos>100){ ypos--; } elem.style.left=xpos+"px"; elem.style.top=ypos+"px"; movement=setTimeout("moveMessage()",10);是不是都在循環(huán),怎么有循環(huán)的作用,求告訴return的作用,謝謝
查看完整描述

1 回答

?
夜盡天明ht

TA貢獻3條經(jīng)驗 獲得超2個贊

大致明白了一點,就是不知道這個return true的作用范圍是怎么規(guī)定的?

查看完整回答
反對 回復(fù) 2016-05-21
  • 1 回答
  • 0 關(guān)注
  • 2060 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號