Horje
direction of scroll on page Code Example
direction of scroll on page
(function () {
    var previousScroll = 0;

    $(window).scroll(function(){
       var currentScroll = $(this).scrollTop();
       if (currentScroll > previousScroll){
           alert('down');
       } else {
          alert('up');
       }
       previousScroll = currentScroll;
    });
}()); //run this anonymous function immediately




Javascript

Related
self or this javascript Code Example self or this javascript Code Example
angular append to FormControl errors Code Example angular append to FormControl errors Code Example
export all functions from js file react Code Example export all functions from js file react Code Example
attempt to index a nil value (global 'esx') Code Example attempt to index a nil value (global 'esx') Code Example
image preview Code Example image preview Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8