function checkStickySupport() { const el = document.createElement('a'); el.style.cssText = 'position:sticky; position:-webkit-sticky; position:-ms-sticky;'; return el.style.position.indexOf('sticky') !== -1; } const isStickySupported = checkStickySupport();