Не уменьщается значение горизонтального тулбара.
Всем добрый день. Ребята, подскажите как сделать уменьшение тулбара, что то вообще сообразить не могу.
// ===================================== var s=200; var timer_is_on=0; var t; function timedCount() { create_line(); document.getElementById('txt').value=s; document.getElementById('test').value=s; s = s-10; t=setTimeout("timedCount()",1000); } function doTimer() { if (!timer_is_on) { timer_is_on=1; timedCount(); } } function stopCount() { clearTimeout(t); timer_is_on=0; } function create_line() { var c = document.getElementById("newCanvas"); var ctx = c.getContext("2d"); ctx.strokeStyle = "rgb(0, 255, 0)"; ctx.beginPath(); ctx.lineWidth = 12; ctx.lineCap = "round"; ctx.moveTo(20, 40); ctx.lineTo(s, 40); ctx.stroke(); } // ===================================== </script> <input type="text" id="txt" > <input type="button" value="?????? ??????!" onclick="doTimer()" /> <input type="button" value="?????????? ??????!" onclick="stopCount()" /> <input type="text" id="test"> |
<input type="text" id="txt" style="width: 30px"> <input type="button" value="?????? ??????!" onclick="doTimer()" style="width: 30px" /> <input type="button" value="?????????? ??????!" onclick="stopCount()" style="width: 30px"/> <input type="text" id="test" style="width: 30px"> достаточно маленький? :thanks: |
Да это я убрал.
|
Долго думал, но так и не понял сути вопроса... На всякий случай
<canvas id="newCanvas" style="width:250px;heigth:250px"></canvas> <input type="text" id="txt" style="width:30px;"> <input type="button" value="start count!" onclick="doTimer()" /> <input type="button" value="stop count!" onclick="stopCount()" /> <input type="text" id="test" style="width:30px;"> <script> var s=200; var timer_is_on=0; var t; function timedCount() { create_line(); document.getElementById('txt').value=s; document.getElementById('test').value=s; s = s-10; t=setTimeout("timedCount()",1000); } function doTimer() { if (!timer_is_on) { timer_is_on=1; timedCount(); } } function stopCount() { clearTimeout(t); timer_is_on=0; } function create_line() { var c = document.getElementById("newCanvas"); var ctx = c.getContext("2d"); ctx.clearRect(0, 0, 249, 249); ctx.strokeStyle = "rgb(0, 255, 0)"; ctx.beginPath(); ctx.lineWidth = 12; ctx.lineCap = "round"; ctx.moveTo(20, 40); ctx.lineTo(s, 40); ctx.stroke(); } // ===================================== </script> |
Часовой пояс GMT +3, время: 06:44. |