Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use onscroll in html5

Shulou Source: shulou.com Published: 2022-06-03 15:04:40 11月14日 Update

This article mainly shows you "how to use onscroll in html5", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use onscroll in html5" this article.

Example

Execute JavaScript when element scrolls

In JavaScript:

Object.onscroll=function () {myScript}

In JavaScript, use the addEventListener () method:

Object.addEventListener ("scroll", myScript)

Note: the addEventListener () method is not supported in Internet Explorer 8 and earlier IE versions.

Technical Details

Technical details

Whether to support bubbling: whether Yes can cancel: NO event type: HTML tag supported by Event:, -,

,

Onscroll event invalidation

Tags: Files events elements entries support content attributes styles articles components methods scaffolding pages learning help development movement anyway in between Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple vpn Xiaomi OPPO Reno Microsoft