blob: 95f7da74fc2abbc944ce80740c574fdca3c4f4cf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
---
title: Window.scroll()
slug: Web/API/Window/scroll
translation_of: Web/API/Window/scroll
---
<div>{{APIRef}}</div>
<h2 id="Summary" name="Summary">Zusammenfassung</h2>
<p><span id="result_box" lang="de"><span class="hps">Scrollt das Fenster</span> <span class="hps">zu einer bestimmten</span> <span class="hps">Stelle im Dokument</span><span>.</span></span></p>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox">window.scroll(<em>x-koord</em>,<em>y-koord</em>)
</pre>
<h3 id="Parameters" name="Parameters">Parameters</h3>
<ul>
<li><code>x-koord</code> <span id="result_box" lang="de"><span class="hps">ist</span> <span class="hps">das Pixel</span> <span class="hps">auf der horizontalen Achse</span> <span class="hps">des Dokuments</span><span>, das Sie </span><span class="hps">in der oberen</span> <span class="hps">linken Ecke angezeigt haben wollen.</span></span></li>
<li><code>y-koord</code> <span id="result_box" lang="de"><span class="hps">ist</span> <span class="hps">das Pixel</span> <span class="hps">auf der vertikalen Achse</span> <span class="hps">des Dokuments</span><span>, das Sie </span><span class="hps">in der oberen</span> <span class="hps">linken Ecke angezeigt haben wollen.</span></span></li>
</ul>
<h2 id="Example" name="Example">Beispiel</h2>
<pre class="brush:html;htmlScript:true;"><!-- <span id="result_box" lang="de"><span class="hps">lege</span> <span class="hps">den 100.</span> <span class="hps">vertikalen</span> <span class="hps">Pixel an der</span> <span class="hps">oberen Fensterrand</span></span> -->
<button onClick="scroll(0, 100);"<span class="short_text" id="result_box" lang="de"><span class="alt-edited">>Klicken, um 100 Pixel nach unten zu scrollen</span></span></button>
</pre>
<h2 id="Notes" name="Notes">Notizen</h2>
<p><a href="/en-US/docs/DOM/window.scrollTo">window.scrollTo</a> ist praktisch dasselbe wie diese Methode. Zum wiederholten Blättern um einen bestimmten Abstand, wird <a href="/en-US/docs/Window.scrollBy">window.scrollBy</a> benutzt. Siehe auch <a href="/en-US/docs/Window.scrollByLines">window.scrollByLines</a>, <a href="/en-US/docs/Window.scrollByPages">window.scrollByPages</a>.</p>
<h2 id="Specification" name="Specification">Spezifikation</h2>
<article class="approved text-content">
<div class="boxed translate-rendered">
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ SpecName('CSSOM View', '#dom-window-scrollto', 'window.scrollTo()') }}</td>
<td>{{ Spec2('CSSOM View') }}</td>
<td>Erste Definition.</td>
</tr>
</tbody>
</table>
</div>
</article>
|