Afficher/masquer le menu
Liens Ecyseo
  • Tags cloud
  • Daily
  • Pictures wall
  • Search
  • Display options
    • Links per page :
    • 20 links
    • 50 links
    • 100 links
  • RSS Feed
  • Login

J'ai besoin d'intimité. Non pas parce que mes actions sont douteuses, mais parce que votre jugement et vos intentions le sont.

5167 links 

page 1 / 1

Liste des liens

[JavaScript] detect down/up scrolling - Le Hollandais Volant - /Yome/links
2016-02-25 11:39 - permalink -

Moi aussi :

// Initial state
var scrollPos = 0;
// adding scroll event
window.addEventListener('scroll', function(){ scrolling() });

// the function : compares the "new" scrolling state with the previous
// (this allows detecting either "up" or "down" scrolling)
// then saves the new in the $previous for the next iteration.

function scrolling() {
    if ((document.body.getBoundingClientRect()).top > scrollPos) {
        console.log('scrolling DOWN');
    } else {
        console.log('scrolling UP');
    }
    scrollPos = (document.body.getBoundingClientRect()).top;
}
code javascript scroll
- http://links.yome.ch/?_14dCg
page 1 / 1


Tags


  • shaarli
  • wikipedia

Tags cloud

Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation
Affiches "loi aviva" créées par Geoffrey Dorne le 13 Mai, 2020 - Mastodon 1 - Mastodon 2