Skip to content

Commit 1a65e45

Browse files
committed
translate task #4
1 parent f369066 commit 1a65e45

File tree

1 file changed

+19
-19
lines changed
  • 2-ui/2-events/03-event-delegation/4-behavior-tooltip

1 file changed

+19
-19
lines changed

2-ui/2-events/03-event-delegation/4-behavior-tooltip/task.md

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

33
---
44

5-
# Tooltip behavior
5+
# سلوك التلميح
66

7-
Create JS-code for the tooltip behavior.
7+
قم بإنشاء كود JS لسلوك التلميح.
88

9-
When a mouse comes over an element with `data-tooltip`, the tooltip should appear over it, and when it's gone then hide.
9+
عندما يأتي الماوس فوق عنصر مع `data-tooltip` ، يجب أن يظهر التلميح فوقه ، وعندما يذهب يختفي.
1010

11-
An example of annotated HTML:
11+
مثال على HTML المشروح:
1212
```html
13-
<button data-tooltip="the tooltip is longer than the element">Short button</button>
14-
<button data-tooltip="HTML<br>tooltip">One more button</button>
13+
<button data-tooltip="التلميح أطول من العنصر">زر قصير</button>
14+
<button data-tooltip="تلميح HTML<br>">زر آخر</button>
1515
```
1616

17-
Should work like this:
17+
يجب أن يعمل هكذا:
1818

1919
[iframe src="solution" height=200 border=1]
2020

21-
In this task we assume that all elements with `data-tooltip` have only text inside. No nested tags (yet).
21+
في هذه المهمة نفترض أن جميع العناصر مع `data-tooltip` لديها نص فقط بداخلها. لا توجد علامات متداخلة (بعد).
2222

23-
Details:
23+
التفاصيل:
2424

25-
- The distance between the element and the tooltip should be `5px`.
26-
- The tooltip should be centered relative to the element, if possible.
27-
- 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.
28-
- The tooltip content is given in the `data-tooltip` attribute. It can be arbitrary HTML.
25+
- يجب أن يكون المسافة بين العنصر والتلميح `5px`.
26+
- يجب أن يكون التلميح مركزًا بالنسبة للعنصر ، إذا كان ذلك ممكنًا.
27+
- يجب ألا يتجاوز التلميح حواف النافذة. عادةً ما يكون فوق العنصر ، ولكن إذا كان العنصر في أعلى الصفحة ولا يوجد مساحة للتلميح ، فأدناه.
28+
- يتم إعطاء محتوى التلميح في سمة `data-tooltip`. يمكن أن يكون HTML تعسفيًا.
2929

30-
You'll need two events here:
31-
- `mouseover` triggers when a pointer comes over an element.
32-
- `mouseout` triggers when a pointer leaves an element.
30+
ستحتاج إلى حدثين هنا:
31+
- يُطلق الحدث `mouseover` عندما يأتي مؤشر فوق عنصر.
32+
- يُطلق الحدث `mouseout` عندما يغادر المؤشر عنصرًا.
3333

34-
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.
34+
يرجى استخدام تفويض الحدث: قم بإعداد معالجين على `document` لتتبع جميع "overs" و "outs" من العناصر مع `data-tooltip` وإدارة التلميحات من هناك.
3535

36-
After the behavior is implemented, even people unfamiliar with JavaScript can add annotated elements.
36+
بعد تنفيذ السلوك ، يمكن حتى للأشخاص غير الملمين بـ JavaScript إضافة عناصر مُلحقة.
3737

38-
P.S. Only one tooltip may show up at a time.
38+
ملاحظة: قد يظهر تلميح واحد فقط في وقت واحد.

0 commit comments

Comments
 (0)