diff --git a/00125.изображения.js b/00125.изображения.js index dd7e6ef..38fa614 100644 --- a/00125.изображения.js +++ b/00125.изображения.js @@ -48,7 +48,7 @@ function обновитьИзображение(путь, имя, свойств эл.id = `изображения-${имя}`; эл.style.position = "absolute"; эл.style.display = "block"; - document.body.appendChild(эл); + document.getElementById("корень").appendChild(эл); мир.изображения.элементы[имя] = эл; // Свойства по умолчанию. эл.style.left = `${ум.x}px`; diff --git a/00130.объекты.js b/00130.объекты.js index d776a50..32cfc6a 100644 --- a/00130.объекты.js +++ b/00130.объекты.js @@ -105,7 +105,7 @@ function обновитьЭлемент(имя, свойство, значени элемент.style.position = "absolute"; элемент.style.display = "block"; элемент.style.transformOrigin = "center"; - document.body.appendChild(элемент); + document.getElementById("корень").appendChild(элемент); мир.объекты.элементы[имя] = элемент; // Свойства по умолчанию. элемент.style.width = `${ум.ширина}px`; diff --git a/index.html b/index.html index 01524a4..113e369 100644 --- a/index.html +++ b/index.html @@ -14,10 +14,14 @@ body { height: 100vh; width: 100vw; + } + #корень { + position: relative; } +