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
راههایی برای جابهجایی/تغییر اندازهی یک پنجره وجود دارد:
178
178
179
179
`win.moveBy(x,y)`
180
-
: Move the window relative to current position `x`pixels to the right and`y`pixels down. Negative values are allowed (to move left/up).
180
+
: پنجره را نسبت به موقعیت فعلی، `x`پیکسل به سمت راست و`y`پیکسل به سمت پایین حرکت میدهد. مقادیر منفی هم مجاز هستند (برای حرکت دادن به چپ/بالا)
181
181
182
182
`win.moveTo(x,y)`
183
-
: Move the window to coordinates `(x,y)`on the screen.
183
+
: پنجره را به مختصات `(x,y)`در صفحه میبرد.
184
184
185
185
`win.resizeBy(width,height)`
186
-
: Resize the window by given `width/height`relative to the current size. Negative values are allowed.
186
+
: پنجره را با اندازههای `width/height`داده شده نسبت به اندازهی فعلی تغییر سایز میدهد. مقادیر منفی مجاز هستند.
187
187
188
188
`win.resizeTo(width,height)`
189
-
: Resize the window to the given size.
189
+
: پنجره را به اندازهی داده شده تغییر اندازه میدهد.
190
190
191
-
There's also`window.onresize` event.
191
+
همچنین یک`window.onresize` event نیز وجود دارد.
192
192
193
-
```warn header="Only popups"
194
-
To prevent abuse, the browser usually blocks these methods. They only work reliably on popups that we opened, that have no additional tabs.
193
+
```warn header="فقط popups"
194
+
.برای اینکه از سواستفاده جلوگیری شود، مرورگر معمولا این متدها را مسدود میکنند. آنها فقط روی پنجرههای بازشو که هیچ صفحهی اضافی ندارند، به طور قابل اعتماد کار میکنند
195
195
```
196
196
197
197
```warn header="No minification/maximization"
198
-
JavaScript has no way to minify or maximize a window. These OS-level functions are hidden from Frontend-developers.
198
+
.پنهان هستند Frontend-developers هیچ راهی برای به حداقل رساندن یا به حداکثر رساندن یک پنجره نیست. این متدها که در سطح سیستمعامل هستند از دید JavaScript در
199
199
200
-
Move/resize methods do not work for maximized/minimized windows.
200
+
.روشهای جابجایی/تغییر اندازه برای پنجرههای حداکثر/حداقل شده کار نمیکنند
201
201
```
202
202
203
-
## Scrolling a window
203
+
## پیمایش یک پنجره
204
204
205
-
We already talked about scrolling a window in the chapter<info:size-and-scroll-window>.
205
+
ما قبلا در مورد scroll کردن یک پنجره در بخش<info:size-and-scroll-window> صحبت کردهایم.
206
206
207
207
`win.scrollBy(x,y)`
208
-
: Scroll the window `x`pixels right and `y`down relative the current scroll. Negative values are allowed.
208
+
: پنجره را نسبت به scroll فعلی، `x`پیکسل به راست و `y`پیکسل به پایین scroll میکند. مقادیر منفی مجاز هستند.
209
209
210
210
`win.scrollTo(x,y)`
211
-
: Scroll the window to the given coordinates `(x,y)`.
211
+
: پنجره را به مختصات داده شده `(x,y)` scroll میکند.
212
212
213
213
`elem.scrollIntoView(top = true)`
214
-
: Scroll the window to make`elem`show up at the top (the default) or at the bottom for `elem.scrollIntoView(false)`.
214
+
: پنجره را scroll میکند که`elem`را در بالا (پیش فرض) یا پایین برای `elem.scrollIntoView(false)` نمایش دهد.
215
215
216
-
There's also`window.onscroll` event.
216
+
همچنین یک`window.onscroll` event نیز هست.
217
217
218
-
## Focus/blur on a window
218
+
## Focus/blur روی یک پنجره
219
219
220
220
Theoretically, there are `window.focus()` and `window.blur()` methods to focus/unfocus on a window. And there are also `focus/blur` events that allow to catch the moment when the visitor focuses on a window and switches elsewhere.
0 commit comments