Skip to content

Commit 76b73b3

Browse files
committed
translete mouse events part 1
1 parent 8a178e9 commit 76b73b3

1 file changed

Lines changed: 27 additions & 21 deletions

File tree

  • 2-ui/3-event-details/1-mouse-events-basics

2-ui/3-event-details/1-mouse-events-basics/article.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,58 @@
1-
# Mouse events
1+
# أحداث الماوس
22

3-
In this chapter we'll get into more details about mouse events and their properties.
3+
في هذا الفصل سنتناول المزيد حول أحداث الماوس وخصائصها.
44

5-
Please note: such events may come not only from "mouse devices", but are also from other devices, such as phones and tablets, where they are emulated for compatibility.
5+
يرجى ملاحظة: هذه الأحداث ليست مقتصرة على "الماوس " ولكن تأتى أيضاً من أجهزة أخرى مثل الهواتف والأجهزة اللوحية، والتى يتم مضاهاتها للتوافق.
66

7-
## Mouse event types
7+
## أنواع أحداث الماوس
88

9-
We've already seen some of these events:
9+
لقد راينا بالفعل بعض هذه الأحداث:
1010

1111
`mousedown/mouseup`
12-
: Mouse button is clicked/released over an element.
12+
13+
:استخدام زر الماوس في النقر / تحرير النقر عن العنصر .
1314

1415
`mouseover/mouseout`
15-
: Mouse pointer comes over/out from an element.
16+
: تحريك مؤشر الماوس فوق / خارج العنصر.
1617

1718
`mousemove`
18-
: Every mouse move over an element triggers that event.
19+
: يعمل هذا الحدث فعلياً مع كل حركة لمؤشر الماوس فوق العنصر.
1920

2021
`click`
21-
: Triggers after `mousedown` and then `mouseup` over the same element if the left mouse button was used.
22+
: يعمل بعد `mousedown`ثم `mouseup` على نفس العنصر بإستخدام الزر الأيسر للماوس.
2223

2324
`dblclick`
24-
: Triggers after two clicks on the same element within a short timeframe. Rarely used nowadays.
25+
: يعمل بعد النقر مرتين على نفس العنصر خلال فترة زمنية قصيرة. نادرا ما يستخدم في الوقت الحاضر.
2526

2627
`contextmenu`
27-
: Triggers when when the right mouse button is pressed. There are other ways to open a context menu, e.g. using a special keyboard key, it triggers in that case also, so it's not exactly the mouse event.
2828

29-
...There are several other events too, we'll cover them later.
29+
:يعمل عندما يتم الضغط على زر الفأرة الأيمن. وهناك طرق أخرى لفتح قائمة السياق ، على سبيل المثال باستخدام مفتاح معين من لوحة المفاتيح ، ويمكن أيضًا استخدامه في هذه الحالة ، لذا فهو ليس بالضبط حدث للماوس .
30+
31+
... وهناك أيضا العديد من الأحداث الأخرى ، واللتى سنتطرق لها لاحقًا
32+
.
3033

31-
## Events order
34+
## نرتيب الأحداث
3235

33-
As you can see from the list above, a user action may trigger multiple events.
36+
كما ترى من القائمة السابقة ، قد يقوم إجراء المستخدم بتشغيل أكثر من حدث أو أحداث متعددة
3437

35-
For instance, a left-button click first triggers `mousedown`, when the button is pressed, then `mouseup` and `click` when it's released.
3638

37-
In cases when a single action initiates multiple events, their order is fixed. That is, the handlers are called in the order `mousedown` -> `mouseup` -> `click`.
39+
على سبيل المثال , عند النقر على الزر الايسر فإن أول حدث يتم تشغيله `mousedown`, عند الضغط على الزر, ثم `mouseup` وبالتالي أيضا `click` عند تحرير النقر.
40+
41+
في الحالات التي يبدأ فيها إجراء واحد أحداثًا متعددة ، فإنه يتم إصلاح ترتيبها. بمعنى ، أنه يقوم باستدعاء الأحداث بالترتيب
42+
`mousedown` -> `mouseup` -> `click`.
3843

3944
```online
40-
Click the button below and you'll see the events. Try double-click too.
45+
لمعاينة الأحداث بوضوح أنقر فوق الزر أدناه. جرب النقر مرتين أيضاً.
46+
47+
في التجربة التالية ، يتم تسجيل جميع أحداث الماوس ، وإذا كان هناك تأخير لأكثر من ثانية واحدة يتم فصلها بخط أفقي متقطع.
4148
42-
On the teststand below all mouse events are logged, and if there is more than a 1 second delay between them they are separated by a horizontal ruler.
4349
44-
Also we can see the `button` property that allows to detect the mouse button, it's explained below.
50+
كما يمكننا أن نرى `button` الذي يسمح لنا باكتشاف زر الماوس ، كما هو موضح أدناه.
4551
46-
<input onmousedown="return logMouse(event)" onmouseup="return logMouse(event)" onclick="return logMouse(event)" oncontextmenu="return logMouse(event)" ondblclick="return logMouse(event)" value="Click me with the right or the left mouse button" type="button"> <input onclick="logClear('test')" value="Clear" type="button"> <form id="testform" name="testform"> <textarea style="font-size:12px;height:150px;width:360px;"></textarea></form>
52+
<input onmousedown="return logMouse(event)" onmouseup="return logMouse(event)" onclick="return logMouse(event)" oncontextmenu="return logMouse(event)" ondblclick="return logMouse(event)" value="أنقر فوقي بزر الماوس الايمن أو الأيسر " type="button"> <input onclick="logClear('test')" value="مسح" type="button"> <form id="testform" name="testform"> <textarea style="font-size:12px;height:150px;width:360px;"></textarea></form>
4753
```
4854

49-
## Mouse button
55+
## زر الماوس
5056

5157
Click-related events always have the `button` property, which allows to get the exact mouse button.
5258

0 commit comments

Comments
 (0)