- Notifications
You must be signed in to change notification settings - Fork179
Coordinates#305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Coordinates#305
Changes fromall commits
Commits
Show all changes
22 commits Select commitHold shift + click to select a range
5e13240
# Coordinates
jenega22a9ca
Update 2-ui/1-document/11-coordinates/article.md
MykolaSopiha6535781
Update 2-ui/1-document/11-coordinates/article.md
MykolaSopiha8f8867f
Update 2-ui/1-document/11-coordinates/article.md
MykolaSopiha281591f
Update 2-ui/1-document/11-coordinates/article.md
MykolaSopihaf7ad8e1
Update 2-ui/1-document/11-coordinates/article.md
MykolaSopiha98c44c0
Update 2-ui/1-document/11-coordinates/2-position-at/task.md
MykolaSopiha617ff86
Update 2-ui/1-document/11-coordinates/2-position-at/source.view/index…
MykolaSopihadf9d7fa
Update 2-ui/1-document/11-coordinates/2-position-at/solution.view/ind…
MykolaSopiha412358f
Update 2-ui/1-document/11-coordinates/2-position-at/solution.md
MykolaSopiha2df5646
Update 2-ui/1-document/11-coordinates/1-find-point-coordinates/soluti…
MykolaSopihaec310ec
Update 2-ui/1-document/11-coordinates/article.md
MykolaSopiha19f81c1
Update 2-ui/1-document/11-coordinates/article.md
MykolaSopiha1bc5be1
Update 2-ui/1-document/11-coordinates/article.md
MykolaSopiha37c5c56
Update 2-ui/1-document/11-coordinates/article.md
MykolaSopiha36b6c29
Update 2-ui/1-document/11-coordinates/article.md
MykolaSopiha883e112
Update 2-ui/1-document/11-coordinates/1-find-point-coordinates/soluti…
MykolaSopiha1461da8
Update 2-ui/1-document/11-coordinates/1-find-point-coordinates/source…
MykolaSopiha33a1d72
Update 2-ui/1-document/11-coordinates/4-position-inside-absolute/task.md
MykolaSopiha364fa27
Update 2-ui/1-document/11-coordinates/3-position-at-absolute/task.md
MykolaSopiha6f6e06e
Update 2-ui/1-document/11-coordinates/3-position-at-absolute/solution.md
MykolaSopihabdc05a1
Update 2-ui/1-document/11-coordinates/article.md
MykolaSopihaFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
18 changes: 9 additions & 9 deletions2-ui/1-document/11-coordinates/1-find-point-coordinates/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions2-ui/1-document/11-coordinates/1-find-point-coordinates/solution.view/index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions2-ui/1-document/11-coordinates/1-find-point-coordinates/source.view/index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
24 changes: 12 additions & 12 deletions2-ui/1-document/11-coordinates/1-find-point-coordinates/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
важливість: 5 | ||
--- | ||
#Знайти координати поля відносно вікна | ||
Уiframeнижче ви можете побачити документ із зеленим «полем». | ||
Використовуючи JavaScript, знайдіть координати кутів відносно вікна, на які вказано стрілками. | ||
Для зручності в документі реалізована невелика функція, яка показує координати кліку. | ||
[iframe border=1 height=360 src="source" link edit] | ||
Ваш код повинен використовувати DOMдля отримання чотирьох пар координат відносно вікна: | ||
1.Верхній лівий, зовнішній кут (це просто). | ||
2.Правий нижній, зовнішній кут (теж просто). | ||
3.Верхній лівий, внутрішній кут (трохи складніше). | ||
4.Правий нижній, внутрішній кут (є кілька способів, оберіть один). | ||
Обчислені координати повинні збігатися з тими, які повертаються клацанням миші. | ||
P.S.Код також повинен працювати, якщо елемент має інший розмір або рамку, тобто не прив’язаний до жодних фіксованих значень. |
6 changes: 3 additions & 3 deletions2-ui/1-document/11-coordinates/2-position-at/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
У цьому завданні нам потрібно лише точно розрахувати координати. Подробиці дивіться в коді. | ||
Зверніть увагу: елементи повинні бути в документі, щоб прочитати`offsetHeight`та інші властивості. | ||
Прихований елемент (`display:none`)або елемент поза документом не має розміру. |
24 changes: 12 additions & 12 deletions2-ui/1-document/11-coordinates/2-position-at/solution.view/index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
26 changes: 13 additions & 13 deletions2-ui/1-document/11-coordinates/2-position-at/source.view/index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions2-ui/1-document/11-coordinates/2-position-at/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
важливість: 5 | ||
--- | ||
#Покажіть примітку біля елемента | ||
Створіть функцію`positionAt(anchor, position, elem)`, яка позиціонує `elem` залежно від `position`біля елемента`anchor`. | ||
Аргумент `position`має бути рядком з будь-яким із 3 значень: | ||
- `"top"` -розмістити `elem`праворуч над `anchor` | ||
- `"right"` -розмістити `elem`безпосередньо праворуч від `anchor` | ||
- `"bottom"` -розмістити `elem`прямо під `anchor` | ||
Аргумент використовується всередині функції `showNote(anchor, position, html)`,наданої у вихідному коді завдання, який створює елемент примітки із заданим`html`і показує його у заданій позиції `position`біля елементу `anchor`. | ||
Ось демонстрація приміток: | ||
[iframe src="solution" height="350" border="1" link] |
6 changes: 3 additions & 3 deletions2-ui/1-document/11-coordinates/3-position-at-absolute/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Рішення насправді досить просте: | ||
-Використовуйте `position:absolute`у CSSзамість`position:fixed`для елемента `.note`. | ||
-Використовуйте функцію[getCoords()](info:coordinates#getCoords)з розділу<info:coordinates>, щоб отримати координати відносно документа. |
10 changes: 5 additions & 5 deletions2-ui/1-document/11-coordinates/3-position-at-absolute/solution.view/index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions2-ui/1-document/11-coordinates/3-position-at-absolute/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
важливість: 5 | ||
--- | ||
#Покажіть примітку біля елемента (абсолютне позиціювання) | ||
Скорегуйте рішення [попереднього завдання](info:task/position-at), щоб для позиціювання примітки використовувалася властивість`position:absolute`замість `position:fixed`. | ||
Це запобіжить «втечу» нотатки від елемента під час прокручування сторінки. | ||
Візьміть розв’язання попереднього завдання за відправну точку. Щоб перевірити прокрутку, додайте стиль `<body style="height: 2000px">`. |
8 changes: 4 additions & 4 deletions2-ui/1-document/11-coordinates/4-position-inside-absolute/solution.view/index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
22 changes: 11 additions & 11 deletions2-ui/1-document/11-coordinates/4-position-inside-absolute/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
важливість: 5 | ||
--- | ||
#Розташуйте примітку всередині елемента (абсолютне позиціювання) | ||
Розширте попереднє завдання<info:task/position-at-absolute>:навчіть функцію`positionAt(anchor, position, elem)`вставляти`elem`всередині `anchor`. | ||
Нові значення для `position`: | ||
- `top-out`, `right-out`, `bottom-out` --працюють так само як і раніше, вони вставляють`elem`над/праворуч/під елементом `anchor`. | ||
- `top-in`, `right-in`, `bottom-in` --вставляють `elem`всередину елемента `anchor`, та прикріпляють його до верхнього/правого/нижнього краю. | ||
Наприклад: | ||
```js | ||
//показує примітку над елементом blockquote | ||
positionAt(blockquote, "top-out", note); | ||
//показує примітку всередині елемента blockquote поряд з верхнім краєм | ||
positionAt(blockquote, "top-in", note); | ||
``` | ||
Результат: | ||
[iframe src="solution" height="310" border="1" link] | ||
Для початку візьміть розв’язання задачі <info:task/position-at-absolute>. |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.