SnippetVamp

Parce que yen a marre de chercher ses bouts de code partout...



TODO 1 ajax 3 astuce 68 auto_ 2 bash 1 bootstrap 14 conversion 2 crossbrowser 3 css 50 debug 10 dothtaccess 1 effets 1 erreurs 1 evenements 2 fallback 1 fichiers 27 filter 1 fonctions 73 form 1 graphisme 11 html 39 javascript 39 jquery 26 lib 2 mail 1 markdown 2 mobile 2 parser 13 php 91 pluXML 4 python 10 responsive 8 securite 17 social 1 texte 16 vanilla 4

.

[JavaScript] detect down/up scrolling - Le Hollandais Volant

[JavaScript] detect down/up scrolling - Le Hollandais Volant

// 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;
}


astuce fonctions javascript

http://lehollandaisvolant.net/?mode=links&id=20160224192625

<iframe width="100%" height="524" src="http://snippetvamp.warriordudimanche.net/snippetvamp.php?embed=56d2b22163aa4" type="text/html"></iframe>

Texte seul - Permalink - Snippet public posté le 28/02/2016

Flux RSS de cette page


SnippetVamp 1.83 par Bronco - Page générée en 0.006 s