Skip to content
Way to detect overflow event support and use it with graceful degradation.
JavaScript CSS
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
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

You can’t perform that action at this time.