From 190de53ac82eceb762b1d5d2a21ab6f62885ff4f Mon Sep 17 00:00:00 2001 From: Erfan Yeganegi Date: Wed, 29 Sep 2021 01:50:17 +0330 Subject: [PATCH 1/7] Update article.md --- .../02-bubbling-and-capturing/article.md | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/2-ui/2-events/02-bubbling-and-capturing/article.md b/2-ui/2-events/02-bubbling-and-capturing/article.md index 00c14df25..c5ad97e82 100644 --- a/2-ui/2-events/02-bubbling-and-capturing/article.md +++ b/2-ui/2-events/02-bubbling-and-capturing/article.md @@ -1,24 +1,24 @@ -# Bubbling and capturing +# بالارفتن و گرفتن -Let's start with an example. +با یک مثال شروع می‌کنیم. -This handler is assigned to `
`, but also runs if you click any nested tag like `` or ``: +این کنترل‌کننده به `
` اختصاص داده شده، اما در صورتی که هر تگ داخل آنرا مانند `` یا `` کلیک کنید، باز هم اجرا می‌شود: ```html autorun height=60 -
- If you click on EM, the handler on DIV runs. +
+ اگر روی EM کلیک کنید، کنترل‌کننده روی DIV اجرا می‌شود.
``` -Isn't it a bit strange? Why does the handler on `
` run if the actual click was on ``? +این رفتار کمی عجیب نیست؟ چرا کنترل‌کننده‌ی روی `
` باید زمانی که اجرا شود که کلیک در اصل روی `` بوده است؟ -## Bubbling +## بالا رفتن حبابی -The bubbling principle is simple. +رفتار بالارفتن حبابی ساده است. -**When an event happens on an element, it first runs the handlers on it, then on its parent, then all the way up on other ancestors.** +**وقتی که رویدادی روی یک عنصر اتفاق می‌افتد، اول کنترل‌کننده‌ها را روی خودش اجرا می‌کند، بعد روی عنصر پدرش اجرا می‌کند، و همینطور تا بالاترین اجداد آن.** -Let's say we have 3 nested elements `FORM > DIV > P` with a handler on each of them: +فرض کنیم که سه عنصر تو در تو به صورت ‍`FORM > DIV > P` با یک کنترل‌کننده روی هر کدام از آن‌ها داشته باشیم: ```html run autorun