Created
March 7, 2020 10:40
-
-
Save ruisaraiva19/8136693e2d292aa4486b9c6b4a361889 to your computer and use it in GitHub Desktop.
Check browser support for position sticky
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment