diff options
Diffstat (limited to 'files/fr/web/api/window/scroll/index.md')
| -rw-r--r-- | files/fr/web/api/window/scroll/index.md | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/files/fr/web/api/window/scroll/index.md b/files/fr/web/api/window/scroll/index.md index 17ae626928..6617af0bf3 100644 --- a/files/fr/web/api/window/scroll/index.md +++ b/files/fr/web/api/window/scroll/index.md @@ -3,22 +3,28 @@ title: window.scroll slug: Web/API/Window/scroll translation_of: Web/API/Window/scroll --- -<p>{{ ApiRef() }}</p> - -<p>Fait glisser la fenêtre vers une position particulière du document</p> -<h3 id="Syntax">Syntax</h3> -<pre class="eval">window.scroll(<i>x-coord</i>,<i>y-coord</i>) -</pre> -<h3 id="Parameters">Parameters</h3> -<ul> - <li><code>x-coord</code> est la position horizontale du pixel que vous voulez voir apparaitre en haut à gauche de l’écran.</li> - <li><code>y-coord</code> est la position verticale du pixel que vous voulez voir apparaitre en haut à gauche de l’écran.</li> -</ul> -<h3 id="Example">Example</h3> -<pre> // Déplace la fenêtre 100px plus bas - <button onClick="scroll(0, 100);">click to scroll down 100 pixels</button> -</pre> -<h3 id="Notes">Notes</h3> -<p><a href="en/Window.scrollTo">window.scrollTo</a> a un effet identique à cette méthode. Pour se déplacer par pas dans la page, utilisez <a href="en/Window.scrollBy">window.scrollBy</a>. Jetez aussi un œil à <a href="en/Window.scrollByLines">window.scrollByLines</a> et <a href="en/Window.scrollByPages">window.scrollByPages</a>.</p> -<h3 id="Specification">Specification</h3> -<p>DOM Level 0. Hors spécification.</p>
\ No newline at end of file +{{ ApiRef() }} + +Fait glisser la fenêtre vers une position particulière du document + +### Syntax + + window.scroll(x-coord,y-coord) + +### Parameters + +- `x-coord` est la position horizontale du pixel que vous voulez voir apparaitre en haut à gauche de l’écran. +- `y-coord` est la position verticale du pixel que vous voulez voir apparaitre en haut à gauche de l’écran. + +### Example + + // Déplace la fenêtre 100px plus bas + <button onClick="scroll(0, 100);">click to scroll down 100 pixels</button> + +### Notes + +[window.scrollTo](en/Window.scrollTo) a un effet identique à cette méthode. Pour se déplacer par pas dans la page, utilisez [window.scrollBy](en/Window.scrollBy). Jetez aussi un œil à [window.scrollByLines](en/Window.scrollByLines) et [window.scrollByPages](en/Window.scrollByPages). + +### Specification + +DOM Level 0. Hors spécification. |
