You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this task we assume that all elements with `data-tooltip`have only text inside. No nested tags.
21
+
В этой задаче можно полагать, что в элементе с атрибутом `data-tooltip`-- только текст, то есть нет подэлементов.
22
22
23
-
Details:
23
+
Детали оформления:
24
24
25
-
-The tooltip should not cross window edges. Normally it should be above the element, but if the element is at the page top and there's no space for the tooltip, then below it.
26
-
-The tooltip is given in the`data-tooltip` attribute. It can be arbitrary HTML.
25
+
-Подсказка не должна вылезать за границы экрана, в том числе если страница частично прокручена. Если нельзя показать сверху -- показывать снизу элемента.
26
+
-Текст подсказки брать из значения атрибута`data-tooltip`. Это может быть произвольный HTML.
27
27
28
-
You'll need two events here:
29
-
-`mouseover`triggers when a pointer comes over an element.
30
-
-`mouseout`triggers when a pointer leaves an element.
28
+
Для решения вам понадобятся два события:
29
+
-`mouseover`срабатывает, когда указатель мыши заходит на элемент.
30
+
-`mouseout`срабатывает, когда указатель мыши уходит с элемента.
31
31
32
-
Please use event delegation: set up two handlers on`document` to track all "overs" and "outs" from elements with `data-tooltip`and manage tooltips from there.
32
+
Примените делегацию событий: установите оба обработчика на элемент`document`, чтобы отслеживать "заход" и "уход" курсора на элементы с атрибутом `data-tooltip`и управлять подсказками с их же помощью.
33
33
34
-
After the behavior is implemented, even people unfamiliar with JavaScript can add annotated elements.
34
+
После реализации поведения -- люди, даже не знакомые с JavaScript смогут аннотировать элементы.
35
35
36
-
P.S. To keep things natural and simple: only one tooltip may show up at a time.
36
+
P.S. Чтобы всё выглядело естественно и просто: показывайте одновременно лишь одну подсказку.
0 commit comments