JS--- 사례: div 너비 설정

1575 단어

예: div 너비 설정

title <span style="color: #000000;"> my$(</span>"btn").onclick = <span style="color: #0000ff;">function</span><span style="color: #000000;"> () { </span><span style="color: #0000ff;">var</span> width = 200<span style="color: #000000;">; </span><span style="color: #0000ff;">var</span> timeId = setInterval(<span style="color: #0000ff;">function</span><span style="color: #000000;"> () { width </span>+= 10<span style="color: #000000;">; </span><span style="color: #0000ff;">if</span> (width == 800<span style="color: #000000;">) { clearInterval(timeId); } my$(</span>"dv").style.width = width + "px"<span style="color: #000000;">; }, </span>100<span style="color: #000000;">); }; </span>

좋은 웹페이지 즐겨찾기