From 1109132f09d75da9a28b649c7677bb6ce07c40c0 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:45 -0500 Subject: initial commit --- .../api/globaleventhandlers/onscroll/index.html | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 files/es/web/api/globaleventhandlers/onscroll/index.html (limited to 'files/es/web/api/globaleventhandlers/onscroll') diff --git a/files/es/web/api/globaleventhandlers/onscroll/index.html b/files/es/web/api/globaleventhandlers/onscroll/index.html new file mode 100644 index 0000000000..017085065a --- /dev/null +++ b/files/es/web/api/globaleventhandlers/onscroll/index.html @@ -0,0 +1,80 @@ +--- +title: GlobalEventHandlers.onscroll +slug: Web/API/GlobalEventHandlers/onscroll +translation_of: Web/API/GlobalEventHandlers/onscroll +--- +
{{ApiRef("HTML DOM")}}
+ +

Un manejador de eventos para desplazamiento en element.

+ +

Sintaxis

+ +
element.onscroll = functionReference
+
+ +

Parámetros

+ +

functionReference es una referencia a una función para ser ejecutada cuando  element es desplazado (enrollado).

+ +

Example

+ +
<!DOCTYPE html>
+<html lang="en">
+  <head>
+  <meta charset="UTF-8" />
+  <style>
+  #container {
+    position: absolute;
+    height: auto;
+    top: 0;
+    bottom: 0;
+    width: auto;
+    left: 0;
+    right: 0;
+    overflow: auto;
+  }
+
+  #foo {
+    height:1000px;
+    width:1000px;
+    background-color: #777;
+    display: block;
+  }
+
+  </style>
+  </head>
+  <body>
+    <div id="container">
+      <div id="foo"></div>
+    </div>
+
+    <script type="text/javascript">
+      document.getElementById('container').onscroll = function() {
+        console.log("scrolling");
+      };
+    </script>
+  </body>
+</html>
+ +

Notas

+ +

El evento es generado cuando el usuario realiza desplazamiento (scrolls) sobre el contenido de un elemento. Element.onscroll es equivalente a element.addEventListener("scroll" ... ).

+ +

Especificaciones

+ + + + + + + + + + + + + + + + +
EspecificaciónEstadoObservaciones
{{SpecName("DOM3 Events", "#event-type-scroll", "onscroll")}}{{Spec2("DOM3 Events")}}Definición inicial
-- cgit v1.2.3-54-g00ecf