Skip to content

Instantly share code, notes, and snippets.

@garvin
garvin / modernizr.positionfixed.js
Last active March 20, 2018 21:47 — forked from bobslaede/modernizr.positionfixed.js
Modernizr position fixed check
;(function(Modernizr, window) {
Modernizr.addTest('positionfixed', function () {
var test = document.createElement('div'),
control = test.cloneNode(false),
fake = false,
root = document.body || (function () {
fake = true;
return document.documentElement.appendChild(document.createElement('body'));
}());