EzDevInfo.com

steady.js

A module to do some logic on the `onscroll` event without performance regressions in a @media-query like conditions. Steady.js

How can I fire an event when an element comes into view using steady.js?

I'm trying to use steady.js to fire an event when an element comes into view. My element has the classname someclass.

var steady = new Steady({
    throttle: 100,
    handler: function(el) {
        console.log('woo!')
    }
});

steady.addTracker('.someclass-top', function(){
    console.log('Top of our someclass element')
});

After scrolling past the .someclass element, I expect the tracker for '.someclass-top' to fire. However nothing happens.


Source: (StackOverflow)