Make JQuery fire when I scroll down the page 900px -
I have a small JQuery script that I want to run when the user scrolls the page down from 900px. I still have it:
& lt; Script & gt; $ (Document) .ready (function () {$ (window) .on ('scroll', function) {if ($ (window) .scrollTop> 900) {jQuery ({counter: 0}). { Counter: $ ('. Single'). Text ()}, {duration: 1000, phase: function () {$ ('. Singles'). Text (math.sil (this. Counter))}}} / / Different values $ ('calculation'). Each (function () {jQuery ({counter: 0}). Animate ({counter: $ (.) .text ()}, {duration: 1000, phase: function () {$ (This) .text (mathematics.Sil (it.kapper));}});});}});}); & Lt; / Script & gt; Now I'm up but it does not seem to work?
You can do it like this
$ (window) .on ('scroll', function (if {$ (window (. ($ (Window) .scrollTop & gt; 900) // // code is scrolled more than 900 pixels, your code to execute}});
Comments
Post a Comment