Skip to content

Commit 7c053dd

Browse files
committed
задание 2
1 parent 1c27290 commit 7c053dd

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
In this task we only need to accurately calculate the coordinates. See the code for details.
1+
В этой задаче нам нужно только аккуратно вычислить координаты. Смотрите код для изучения деталей реализации.
22

3-
Please note: the elements must be in the document to read `offsetHeight` and other properties.
4-
A hidden (`display:none`) or out of the document element has no size.
3+
Обратите внимание, что элементы должны уже быть в документе перед чтением `offsetHeight` и других свойств.
4+
Спрятанный (`display:none`) элемент или элемент вне документа не имеют размеров.

2-ui/1-document/11-coordinates/2-position-at/solution.view/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424

2525
<script>
2626
/**
27-
* Positions elem relative to anchor as said in position.
27+
* Позиционирует элемент elem относительно элемента anchor в соответствии со значением position.
2828
*
29-
* @param {Node} anchor Anchor element for positioning
30-
* @param {string} position One of: top/right/bottom
31-
* @param {Node} elem Element to position
29+
* @param {Node} anchor элемент, около которого позиционируется другой элемент
30+
* @param {string} position одно из: top/right/bottom
31+
* @param {Node} elem элемент, который позиционируется
3232
*
33-
* Both elements: elem and anchor must be in the document
33+
* Оба элемента elem и anchor должны присутствовать в документе
3434
*/
3535
function positionAt(anchor, position, elem) {
3636

@@ -56,8 +56,8 @@
5656
}
5757

5858
/**
59-
* Shows a note with the given html at the given position
60-
* relative to the anchor element.
59+
* Показывает заметку с заданным содержимым на заданной позиции
60+
* относительно элемента anchor.
6161
*/
6262
function showNote(anchor, position, html) {
6363

@@ -69,7 +69,7 @@
6969
positionAt(anchor, position, note);
7070
}
7171

72-
// test it
72+
// проверка
7373
let blockquote = document.querySelector('blockquote');
7474

7575
showNote(blockquote, "top", "note above");

2-ui/1-document/11-coordinates/2-position-at/source.view/index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,24 @@
2424

2525
<script>
2626
/**
27-
* Positions elem relative to anchor as said in position.
27+
* Позиционирует элемент elem относительно элемента anchor в соответствии со значением position.
2828
*
29-
* @param {Node} anchor Anchor element for positioning
30-
* @param {string} position One of: top/right/bottom
31-
* @param {Node} elem Element to position
29+
* @param {Node} anchor элемент, около которого позиционируется другой элемент
30+
* @param {string} position одно из: top/right/bottom
31+
* @param {Node} elem элемент, который позиционируется
3232
*
33-
* Both elements: elem and anchor must be in the document
33+
* Оба элемента elem и anchor должны присутствовать в документе
3434
*/
3535
function positionAt(anchor, position, elem) {
36-
// ... your code ...
36+
// ... ваш код ...
3737
}
3838

3939
/**
40-
* Shows a note with the given html at the given position
41-
* relative to the anchor element.
40+
* Показывает заметку с заданным содержимым на заданной позиции
41+
* относительно элемента anchor.
4242
*/
4343
function showNote(anchor, position, html) {
44-
// ... your code ...
44+
// ... ваш код ...
4545
}
4646

4747
// test it

2-ui/1-document/11-coordinates/2-position-at/task.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ importance: 5
22

33
---
44

5-
# Show a note near the element
5+
# Покажите заметку рядом с элементом
66

7-
Create a function `positionAt(anchor, position, elem)` that positions `elem`, depending on `position` either at the top (`"top"`), right (`"right"`) or bottom (`"bottom"`) of the element `anchor`.
7+
Создайте функцию `positionAt(anchor, position, elem)`, которая позиционировала бы элемент `elem` в зависимости от значения свойства `position` сверху (`"top"`), справа (`"right"`) или снизу (`"bottom"`) от элемента `anchor`.
88

9-
Call it inside the function `showNote(anchor, position, html)` that shows an element with the class `"note"` and the text `html` at the given position near the anchor.
9+
Используйте эту функцию внутри функции `showNote(anchor, position, html)`, которая показывает элемент с классом `"note"` и текст `html` на заданной позиции вблизи элемента `anchor`.
1010

11-
Show the notes like here:
11+
Заметка должна показываться как здесь:
1212

1313
[iframe src="solution" height="350" border="1" link]
1414

15-
P.S. The note should have `position:fixed` for this task.
15+
P.S. В этой задаче следует применять CSS-позиционирование с помощью свойства `position:fixed`.

0 commit comments

Comments
 (0)