Way to detect overflow event support and use it with graceful degradation.
JavaScript CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets
src
README.md
index.html

README.md

useOverflowEvent.js

Way to detect overflow event support and use it with graceful degradation. Overflow event now supported on Chrome(tested on 9+) and Firefox(tested on 1.5+).

DEMO

HOW TO USE

useOverflowEvent(function (addOverflowListener) {
    if (!addOverflowListener) {
        // browser not support overflow event
        // do somethings or nothing
        return;
    }

    var container = document.getElementById('demo');
    addOverflowListener(container, 'over', function () {
        console.log('overflow');
    });
    addOverflowListener(container, 'under', function () {
        console.log('underflow');
    });
});

LICENTSE

MIT