Показать сообщение отдельно
  #6 (permalink)  
Старый 30.06.2022, 23:01
Новичок на форуме
Отправить личное сообщение для sober Посмотреть профиль Найти все сообщения от sober
 
Регистрация: 30.06.2022
Сообщений: 6

Сообщение от Nexus Посмотреть сообщение
sober, это же не полный скрипт?
Где и как вызывается функция ChangeSign?

Давно такого Индусского кода не видел =)
Вот только не смейтесь

Полностью страница выглядит так:
<body>

 <td class="centerColumn">
 <div id="textBlock">
 <!-- <body> -->
[css]
<style>
 h1{
 color:black;
 font-family: Palatino Linotype;
 }
 div{
 font-family: Palatino Linotype;
 }
 #XO{
 background-color:#A5DEFF;
 position:relative;
 width: 400px;
 }
 div.square{
 position:absolute;
 height:20px;
 width:20px;
 cursor:pointer;
 }
</style>
[css]
[js]
<script>
 var squares = [];
 var squares_signs = []
 function Initialization(){
 for (var i = 0; i < 38001; i++){
 squares[i] = document.getElementById("square"+i);
 }
 for (var i = 0; i < 38001; i++){
 squares[i].innerHTML = "<img src = 'empty.png'>";
 squares_signs[i] = 0;
 }
 }
 function ChangeSign(square_i){
 squares[square_i].innerHTML = "<img src = 'circle.png'>";

 if (squares_signs[square_i] == 0){
 squares[square_i].innerHTML = "<img src = 'circle.png'>";
 squares_signs[square_i] = 1;
 return;
 }
 if (squares_signs[square_i] == 1){
 squares[square_i].innerHTML = "<img src = 'cross.png'>";
 squares_signs[square_i] = 2;
 return;
 }
 if (squares_signs[square_i] == 2){
 squares[square_i].innerHTML = "<img src = 'dus.png'>";
 squares_signs[square_i] = 3;
 return;
 }
 if (squares_signs[square_i] == 3){
 squares[square_i].innerHTML = "<img src = 'puat.png'>";
 squares_signs[square_i] = 4;
 return;
 }
 if (squares_signs[square_i] == 4){
 squares[square_i].innerHTML = "<img src = 'chest.png'>";
 squares_signs[square_i] = 5;
 return;
 }
 if (squares_signs[square_i] == 5){
 squares[square_i].innerHTML = "<img src = 'seem.png'>";
 squares_signs[square_i] = 6;
 return;
 }
 if (squares_signs[square_i] == 6){
 squares[square_i].innerHTML = "<img src = 'voosem.png'>";
 squares_signs[square_i] = 7;
 return;
 }
 if (squares_signs[square_i] == 7){
 squares[square_i].innerHTML = "<img src = 'deeviat.png'>";
 squares_signs[square_i] = 8;
 return;
 }
 if (squares_signs[square_i] == 8){
 squares[square_i].innerHTML = "<img src = 'des.png'>";
 squares_signs[square_i] = 9;
 return;
 }
 if (squares_signs[square_i] == 9){
 squares[square_i].innerHTML = "<img src = 'odincat.png'>";
 squares_signs[square_i] = 10;
 return;
 }
 if (squares_signs[square_i] == 10){
 squares[square_i].innerHTML = "<img src = 'empty.png'>";
 squares_signs[square_i] = 0;
 }
 }
</script>
[/js]

<div id = "XO">
 
 <div class="square"id="square0" style = "left:0px; top:0px;" onclick = "ChangeSign(0);"></div>
 <div class="square"id="square1" style = "left:15px; top:0px;" onclick = "ChangeSign(1);"></div>
 <div class="square"id="square2" style = "left:30px; top:0px;" onclick = "ChangeSign(2);"></div>
 <div class="square"id="square3" style = "left:45px; top:0px;" onclick = "ChangeSign(3);"></div>
 <div class="square"id="square4" style = "left:60px; top:0px;" onclick = "ChangeSign(4);"></div>
 <div class="square"id="square5" style = "left:75px; top:0px;" onclick = "ChangeSign(5);"></div>
 <div class="square"id="square6" style = "left:90px; top:0px;" onclick = "ChangeSign(6);"></div>
 <div class="square"id="square7" style = "left:105px; top:0px;" onclick = "ChangeSign(7);"></div>
 <div class="square"id="square8" style = "left:120px; top:0px;" onclick = "ChangeSign(8);"></div>
 <div class="square"id="square9" style = "left:135px; top:0px;" onclick = "ChangeSign(9);"></div>
 <div class="square"id="square10" style = "left:150px; top:0px;" onclick = "ChangeSign(10);"></div>
 <div class="square"id="square11" style = "left:165px; top:0px;" onclick = "ChangeSign(11);"></div>
 <div class="square"id="square12" style = "left:180px; top:0px;" onclick = "ChangeSign(12);"></div>
 <div class="square"id="square13" style = "left:195px; top:0px;" onclick = "ChangeSign(13);"></div>
 <div class="square"id="square14" style = "left:210px; top:0px;" onclick = "ChangeSign(14);"></div>
 <div class="square"id="square15" style = "left:225px; top:0px;" onclick = "ChangeSign(15);"></div>
 <div class="square"id="square16" style = "left:240px; top:0px;" onclick = "ChangeSign(16);"></div>
 <div class="square"id="square17" style = "left:255px; top:0px;" onclick = "ChangeSign(17);"></div>
 <div class="square"id="square18" style = "left:270px; top:0px;" onclick = "ChangeSign(18);"></div>
 <div class="square"id="square19" style = "left:285px; top:0px;" onclick = "ChangeSign(19);"></div>
 <div class="square"id="square20" style = "left:300px; top:0px;" onclick = "ChangeSign(20);"></div>
 <div class="square"id="square21" style = "left:315px; top:0px;" onclick = "ChangeSign(21);"></div>
 <div class="square"id="square22" style = "left:330px; top:0px;" onclick = "ChangeSign(22);"></div>
 <div class="square"id="square23" style = "left:345px; top:0px;" onclick = "ChangeSign(23);"></div>
 <div class="square"id="square24" style = "left:360px; top:0px;" onclick = "ChangeSign(24);"></div>
 <div class="square"id="square25" style = "left:375px; top:0px;" onclick = "ChangeSign(25);"></div>
 <div class="square"id="square26" style = "left:390px; top:0px;" onclick = "ChangeSign(26);"></div>
 <div class="square"id="square27" style = "left:405px; top:0px;" onclick = "ChangeSign(27);"></div>
 <div class="square"id="square28" style = "left:420px; top:0px;" onclick = "ChangeSign(28);"></div>
 <div class="square"id="square29" style = "left:435px; top:0px;" onclick = "ChangeSign(29);"></div>
 <div class="square"id="square30" style = "left:450px; top:0px;" onclick = "ChangeSign(30);"></div>
 <div class="square"id="square31" style = "left:465px; top:0px;" onclick = "ChangeSign(31);"></div>
 <div class="square"id="square32" style = "left:480px; top:0px;" onclick = "ChangeSign(32);"></div>
 <div class="square"id="square33" style = "left:495px; top:0px;" onclick = "ChangeSign(33);"></div>
 <div class="square"id="square34" style = "left:510px; top:0px;" onclick = "ChangeSign(34);"></div>
 <div class="square"id="square35" style = "left:525px; top:0px;" onclick = "ChangeSign(35);"></div>
 <div class="square"id="square36" style = "left:540px; top:0px;" onclick = "ChangeSign(36);"></div>
 <div class="square"id="square37" style = "left:555px; top:0px;" onclick = "ChangeSign(37);"></div>
 <div class="square"id="square38" style = "left:570px; top:0px;" onclick = "ChangeSign(38);"></div>
 <div class="square"id="square39" style = "left:585px; top:0px;" onclick = "ChangeSign(39);"></div>
 <div class="square"id="square40" style = "left:600px; top:0px;" onclick = "ChangeSign(40);"></div>
 <div class="square"id="square41" style = "left:615px; top:0px;" onclick = "ChangeSign(41);"></div>
 <div class="square"id="square42" style = "left:630px; top:0px;" onclick = "ChangeSign(42);"></div>
 <div class="square"id="square43" style = "left:645px; top:0px;" onclick = "ChangeSign(43);"></div>
 <div class="square"id="square44" style = "left:660px; top:0px;" onclick = "ChangeSign(44);"></div>
 <div class="square"id="square45" style = "left:675px; top:0px;" onclick = "ChangeSign(45);"></div>
 <div class="square"id="square46" style = "left:690px; top:0px;" onclick = "ChangeSign(46);"></div>
 <div class="square"id="square47" style = "left:705px; top:0px;" onclick = "ChangeSign(47);"></div>
 <div class="square"id="square48" style = "left:720px; top:0px;" onclick = "ChangeSign(48);"></div>
 <div class="square"id="square49" style = "left:735px; top:0px;" onclick = "ChangeSign(49);"></div>
 <div class="square"id="square50" style = "left:750px; top:0px;" onclick = "ChangeSign(50);"></div>

</div>

<script>
 Initialization();
</script><!-- </body> -->
 </div>
 </td>

</body>

Последний раз редактировалось sober, 30.06.2022 в 23:58.
Ответить с цитированием