Skip to content

zmmbreeze/useOverflowEvent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Way to detect overflow event support and use it with graceful degradation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published