summaryrefslogtreecommitdiff
path: root/source/bower_components/modernizr/feature-detects/css-positionsticky.js
blob: 43a19ec0a55d8d697d0a5053fcb1a974041c0ffc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Sticky positioning - constrains an element to be positioned inside the
// intersection of its container box, and the viewport.
Modernizr.addTest('csspositionsticky', function () {

    var prop = 'position:';
    var value = 'sticky';
    var el = document.createElement('modernizr');
    var mStyle = el.style;

    mStyle.cssText = prop + Modernizr._prefixes.join(value + ';' + prop).slice(0, -prop.length);

    return mStyle.position.indexOf(value) !== -1;
});