Хочу сделать так чтоы квадраты останавливались вместе, задаю параметры top и left (bottom и right) одинаковым, равными 210, НО останавливатся вместе они не хотят.
to Sardar знаю, знаю коряво... ну не могу я по другому, НЕ МОГУ.
| Код | <html> <head> <script type="text/javascript"> <!--
/*приходится присваивать данные простыми числами, document.getElementById("id").style.top; передает данные с "PX". */ var topIMG1=10; var leftIMG1=10; var topIMG2=10; var rightIMG2=10; var bottomIMG3=10; var rightIMG3=10; var bottomIMG4=10; var leftIMG4=10; //Блок 1 //задаем setTimeGo1 вызов 4 функций. var setTimeGo1=window.setInterval("f1(),f2(),f3(),f4()", 50); function f1() { document.getElementById("img1").style.top=topIMG2++; if (topIMG1==210) {clearInterval(setTimeGo1);} } function f2() { document.getElementById("img2").style.top=topIMG2++; if (topIMG2==210) {clearInterval(setTimeGo1);} } function f3() { document.getElementById("img3").style.bottom=bottomIMG3++; if (bottomIMG3==210) {clearInterval(setTimeGo1);} } function f4() { document.getElementById("img4").style.bottom=bottomIMG4++; if (bottomIMG4==210) {clearInterval(setTimeGo1);} }
//Блок 2 var setTimeGo2=window.setInterval("f12(),f22(),f32(),f42()", 50); function f12() { document.getElementById("img1").style.left=leftIMG1++; if (leftIMG1==210) {clearInterval(setTimeGo2);} } function f22() { document.getElementById("img2").style.right=rightIMG2++; if (rightIMG2==210) {clearInterval(setTimeGo2);} } function f32() { document.getElementById("img3").style.right=rightIMG3++; if (rightIMG3==210) {clearInterval(setTimeGo2);} } function f42() { document.getElementById("img4").style.left=leftIMG4++; if (leftIMG4==210) {clearInterval(setTimeGo2);} } //--> </script> </head> <body> <div id="img1" style="position:absolute; top:10px;left:10px;visiblilyte:visible;width:120px; height:90px;color:silver;background-color:blue;z-index:0;overflow:hidden ">
<img src="img/miamai.jpg" id="img1"> КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА
</div>
<div id="img2" style="position:absolute; top:10px;right:10px;visiblilyte:visible;width:120px; height:90px;color:silver;background-color:blue;z-index:0;overflow:hidden ">
<img src="img/miamai.jpg" id="img1"> КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА
</div>
<div id="img3" style="position:absolute; bottom:10px;right:10px;visiblilyte:visible;width:120px; height:90px;color:silver;background-color:blue;z-index:0;overflow:hidden ">
<img src="img/miamai.jpg" id="img1"> КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА
</div>
<div id="img4" style="position:absolute; bottom:10px;left:10px;visiblilyte:visible;width:120px; height:90px;color:silver;background-color:blue;z-index:0;overflow:hidden ">
<img src="img/miamai.jpg" id="img1"> КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА КАРТИНА
</div> <input type="button" onClick="f2()" value="Скрытый"> </body> </html>
| |